/** Adds the given object at the end of the Chain. */ @Override public void addLast(E u) { innerChain.addLast(u); }
/** * This method adds a STOP node to the graph, if necessary, to make the CFG single-tailed. */ protected void handleMultipleReturns() { if (this.getTails().size() > 1) { Unit stop = new ExitStmt(); List<Unit> predsOfstop = new ArrayList<Unit>(); for (Unit tail : this.getTails()) { predsOfstop.add(tail); List<Unit> tailSuccs = this.unitToSuccs.get(tail); if (tailSuccs == null) { tailSuccs = new ArrayList<Unit>(); this.unitToSuccs.put(tail, tailSuccs); } tailSuccs.add(stop); } this.unitToPreds.put(stop, predsOfstop); this.unitToSuccs.put(stop, new ArrayList<Unit>()); Chain<Unit> units = body.getUnits().getNonPatchingChain(); if (!units.contains(stop)) { units.addLast(stop); } } }
JPegStmt s = (JPegStmt) mainIt.next(); mainPegChain.addLast(s);
accStmts.add(Jimple.v().newAssignStmt(Jimple.v().newStaticFieldRef(ref.getFieldRef()), l)); accStmts.addLast(Jimple.v().newReturnVoidStmt()); Type returnType = VoidType.v();
/** Adds the given object at the end of the Chain. */ public void addLast(E u) { innerChain.addLast(u); }
/** Adds the given object at the end of the Chain. */ public void addLast(E u) { innerChain.addLast(u); }
/** * returns a new local with the given prefix and the given type.<br> * the returned local will automaticly added to the locals-chain. * The local will be of the form: <tt>prefix</tt><i>X</i> (where the last * <i>X</i> is a number, so the localname is unique). * * @param prefix the prefix for the now local. * @param type the Type of the now local. * @return a local with the given prefix and the given type. */ public Local newLocal(String prefix, Type type) { int suffix = 0; if (prefix == this.prefix || prefix.equals(this.prefix)) { suffix = counter; } while (locals.contains(prefix + suffix)) suffix++; if (prefix == this.prefix || prefix.equals(this.prefix)) { counter = suffix + 1; } String newName = prefix + suffix; Local newLocal = Jimple.v().newLocal(newName, type); localChain.addLast(newLocal); locals.add(newName); return newLocal; } }
/** * returns a new local with the given prefix and the given type.<br> * the returned local will automaticly added to the locals-chain. * The local will be of the form: <tt>prefix</tt><i>X</i> (where the last * <i>X</i> is a number, so the localname is unique). * * @param prefix the prefix for the now local. * @param type the Type of the now local. * @return a local with the given prefix and the given type. */ public Local newLocal(String prefix, Type type) { int suffix = 0; if (prefix == this.prefix || prefix.equals(this.prefix)) { suffix = counter; } while (locals.contains(prefix + suffix)) suffix++; if (prefix == this.prefix || prefix.equals(this.prefix)) { counter = suffix + 1; } String newName = prefix + suffix; Local newLocal = Jimple.v().newLocal(newName, type); localChain.addLast(newLocal); locals.add(newName); return newLocal; } }
units.addLast(stop);
units.addLast(stop);