public void caseGotoStmt(GotoStmt s) { GotoStmt newStmt = (GotoStmt) (oldToNew.get(s)); newStmt.setTarget(oldToNew.get(newStmt.getTarget())); }
((GotoStmt) loopTail).setTarget(copiedHead); } else if (loopTail instanceof IfStmt) { if (((IfStmt) loopTail).getTarget() == condition.getHead()) {
@Override protected void internalTransform(Body b, String phaseName, Map<String, String> options) { for (Iterator<Unit> unitIt = b.getUnits().snapshotIterator(); unitIt.hasNext();) { Unit u = unitIt.next(); if (u instanceof GotoStmt) { GotoStmt stmt = (GotoStmt) u; while (stmt.getTarget() instanceof GotoStmt) { GotoStmt nextTarget = (GotoStmt) stmt.getTarget(); stmt.setTarget(nextTarget.getTarget()); } } else if (u instanceof IfStmt) { IfStmt stmt = (IfStmt) u; while (stmt.getTarget() instanceof GotoStmt) { GotoStmt nextTarget = (GotoStmt) stmt.getTarget(); stmt.setTarget(nextTarget.getTarget()); } } } }
((GotoStmt) s).setTarget(b.succ.firstElement().getHeadJStmt()); } else {
newTarget = stmt; ((GotoStmt) stmt).setTarget(newTarget); updateCounters(1, true); } else if (target instanceof IfStmt) {
if (inlineeStmt instanceof GotoStmt) { System.out.println("inlinee goto target: " + ((GotoStmt) inlineeStmt).getTarget()); ((GotoStmt) oldStmtsToNew.get(inlineeStmt)).setTarget(oldStmtsToNew.get(((GotoStmt) inlineeStmt).getTarget()));
private void patch_Stmt(Stmt src, Stmt oldDst, Stmt newDst) { if (src instanceof GotoStmt) { ((GotoStmt) src).setTarget(newDst); return;
((GotoStmt)loopTail).setTarget(copiedHead); else if (loopTail instanceof IfStmt) { if (((IfStmt)loopTail).getTarget() == condition.getHead())
((GotoStmt)loopTail).setTarget(copiedHead); else if (loopTail instanceof IfStmt) { if (((IfStmt)loopTail).getTarget() == condition.getHead())
((GotoStmt)s).setTarget(b.succ.firstElement().getHeadJStmt());
((GotoStmt)s).setTarget(b.succ.firstElement().getHeadJStmt());
if (inlineeStmt instanceof GotoStmt){ System.out.println("inlinee goto target: "+((GotoStmt)inlineeStmt).getTarget()); ((GotoStmt)oldStmtsToNew.get(inlineeStmt)).setTarget(oldStmtsToNew.get(((GotoStmt)inlineeStmt).getTarget()));
if (inlineeStmt instanceof GotoStmt){ System.out.println("inlinee goto target: "+((GotoStmt)inlineeStmt).getTarget()); ((GotoStmt)oldStmtsToNew.get(inlineeStmt)).setTarget(oldStmtsToNew.get(((GotoStmt)inlineeStmt).getTarget()));
if (newTarget == null) newTarget = stmt; ((GotoStmt)stmt).setTarget(newTarget); updateCounters(1, true);
if (newTarget == null) newTarget = stmt; ((GotoStmt)stmt).setTarget(newTarget); updateCounters(1, true);