public void caseIfStmt(IfStmt s) { IfStmt newStmt = (IfStmt) (oldToNew.get(s)); newStmt.setTarget(oldToNew.get(newStmt.getTarget())); }
public IfStmt newIfStmt(IfStmt s) { return new GIfStmt(s.getCondition(), s.getTarget()); }
@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()); } } } }
@Override public void caseIfStmt(IfStmt stmt) { Stmt target = stmt.getTarget(); exprV.setOrigStmt(stmt); exprV.setTargetForOffset(target); stmt.getCondition().apply(exprV); }
private void transformBody(Body b, Stmt next) { // change target of stmts 0 and 1 to target of stmt 5 // remove stmts 2, 3, 4, 5 Stmt newTarget = null; Stmt oldTarget = null; if (sameGoto) { newTarget = ((IfStmt) stmtSeq[5]).getTarget(); } else { newTarget = next; oldTarget = ((IfStmt) stmtSeq[5]).getTarget(); } ((IfStmt) stmtSeq[0]).setTarget(newTarget); ((IfStmt) stmtSeq[1]).setTarget(newTarget); for (int i = 2; i <= 5; i++) { b.getUnits().remove(stmtSeq[i]); } if (!sameGoto) { b.getUnits().insertAfter(Jimple.v().newGotoStmt(oldTarget), stmtSeq[1]); } }
((GotoStmt) loopTail).setTarget(copiedHead); } else if (loopTail instanceof IfStmt) { if (((IfStmt) loopTail).getTarget() == condition.getHead()) { ((IfStmt) loopTail).setTarget(copiedHead); } else {
public void caseIfStmt(IfStmt stmt) { String varName = printValueAssignment(stmt.getCondition(), "condition"); Unit target = stmt.getTarget(); vtp.suggestVariableName("target"); String targetName = vtp.getLastAssignedVarName(); p.println("Unit " + targetName + "=" + nameOfJumpTarget(target) + ";"); printStmt(stmt, varName, targetName); }
Unit target = ((IfStmt) os).getTarget(), newTgt = null;
AugmentedStmt succIf = asg.get_AugStmt(ifs.getTarget()), succElse = (AugmentedStmt) as.bsuccs.get(0);
target = ((IfStmt) stmt).getTarget();
Unit t = ifstmt.getTarget();
Stmt targetUnit = ifstmt.getTarget(); Block targetBlock = (Block) succs.get(0); Block nextBlock = (Block) succs.get(1);
Stmt newStmt = Jimple.v().newGotoStmt(ifs.getTarget()); units.insertAfter(newStmt, stmt); numTrue++;
IfStmt ifs = (IfStmt) src; if (ifs.getTarget() == oldDst) { ifs.setTarget(newDst);
units.insertAfter(jgs, u); JGotoStmt jumper = new JGotoStmt((Unit) ifs.getTarget()); units.insertAfter(jumper, jgs); ifs.setTarget((Unit) jumper);
if (isTarget(((IfStmt) stmtSeq[0]).getTarget(), s) && sameLocal(stmtSeq[2], s)) { stmtSeq[pos] = s; return true;
public void piHandleIfStmt(Local local, IfStmt u) { Unit target = u.getTarget();
newstmt = Jimple.v().newGotoStmt(is.getTarget());
if (cycle_body.contains(asg.get_AugStmt(condition.getTarget())) == false) { condition.setCondition(ConditionFlipper.flip((ConditionExpr) condition.getCondition()));