/** Removes the first object from this Chain. */ @Override public void removeFirst() { remove(innerChain.getFirst()); }
/** Removes the last object from this Chain. */ @Override public void removeLast() { remove(innerChain.getLast()); }
Unit pop = (Unit) it.next(); if (!targets.contains(pop)) { u.remove(pop);
protected void internalTransform(Body b, String phaseName, Map<String, String> options) { if (b.getMethod().getName().indexOf("<clinit>") >= 0) { return; } int weight = soot.jbco.Main.getWeight(phaseName, b.getMethod().getSignature()); if (weight == 0) { return; } PatchingChain<Unit> units = b.getUnits(); Iterator<Unit> iter = units.snapshotIterator(); while (iter.hasNext()) { Unit u = (Unit) iter.next(); if (u instanceof PushInst) { SootField f = CollectConstants.constantsToFields.get(((PushInst) u).getConstant()); if (f != null && Rand.getInt(10) <= weight) { Unit get = Baf.v().newStaticGetInst(f.makeRef()); units.insertBefore(get, u); BodyBuilder.updateTraps(get, u, b.getTraps()); units.remove(u); updated++; } } } } }
units.remove(after);
units.remove(suc);
u.insertBefore(Baf.v().newXorInst(LongType.v()), unit); u.insertBefore(Baf.v().newStoreInst(LongType.v(), nloc), unit); u.remove(unit); u.insertBefore(Baf.v().newPrimitiveCastInst(t, origType), unit); u.remove(unit); u.insertBefore(Baf.v().newXorInst(LongType.v()), unit); u.insertBefore(Baf.v().newStoreInst(LongType.v(), nloc), unit); u.remove(unit);
units.remove(reorderingUnit); units.add(reorderingUnit);
units.remove(s); units.insertAfter(s, end); units.insertAfter(endLabel, s);
units.remove(csr.entermonitor); csr.entermonitor = newEntermonitor; units.remove(exitmonitor); newEarlyEnds.add(new Pair<Stmt, Stmt>(earlyEnd, newExitmonitor)); } else { units.remove(exitmonitor); csr.end = new Pair<Stmt, Stmt>(csr.end.getO1(), newExitmonitor); } else { units.remove(exitmonitor); csr.exceptionalEnd = new Pair<Stmt, Stmt>(csr.exceptionalEnd.getO1(), newExitmonitor); } else { units.remove(sNotify);
/** Removes the last object from this Chain. */ public void removeLast() { remove(innerChain.getLast()); }
/** Replaces <code>out</code> in the Chain by <code>in</code>. */ public void swapWith(E out, E in) { insertBefore(in, out); remove(out); }
/** Removes the first object from this Chain. */ public void removeFirst() { remove(innerChain.getFirst()); }
/** Removes the last object from this Chain. */ public void removeLast() { remove(innerChain.getLast()); }
/** Replaces <code>out</code> in the Chain by <code>in</code>. */ public void swapWith(E out, E in) { insertBefore(in, out); remove(out); }
/** Removes the first object from this Chain. */ public void removeFirst() { remove(innerChain.getFirst()); }
public void applyTransformation() { for (JimpleBody body : this.getSceneBodies()) { Map<Unit, List<Unit>> toReplace = new LinkedHashMap<Unit, List<Unit>>(); PatchingChain<Unit> units = body.getUnits(); for (Unit u : units) { if (u instanceof SwitchStmt) { toReplace.put(u, replaceSwitchStatement((SwitchStmt) u)); } } for (Entry<Unit, List<Unit>> entry : toReplace.entrySet()) { units.insertBefore(entry.getValue(), entry.getKey()); units.remove(entry.getKey()); } body.validate(); } }
/** * Removes if statements that jump to the fall-through successor * @param body The body from which to remove unnecessary if statements */ private void eliminateFallthroughIfs(Body body) { boolean changed = false; do { changed = false; IfStmt ifs = null; Iterator<Unit> unitIt = body.getUnits().snapshotIterator(); while (unitIt.hasNext()) { Unit u = unitIt.next(); if (ifs != null && ifs.getTarget() == u) { body.getUnits().remove(ifs); changed = true; } ifs = null; if (u instanceof IfStmt) ifs = (IfStmt) u; } } while (changed); }