public void inASTStatementSequenceNode(ASTStatementSequenceNode node) { for (AugmentedStmt as : node.getStatements()) { Stmt s = as.get_Stmt(); Iterator tempIt = s.getUseBoxes().iterator(); while (tempIt.hasNext()) { ValueBox tempBox = (ValueBox) tempIt.next(); // System.out.println("Checking useBox of stmt"); checkAndSwitch(tempBox); } } }
public void checkStatementUses(Stmt s, Object useNodeOrStatement) { List useBoxes = s.getUseBoxes(); // System.out.println("Uses in this statement:"+useBoxes); List<Value> uses = getUsesFromBoxes(useBoxes); // System.out.println("Local Uses in this statement:"+uses); Iterator<Value> it = uses.iterator(); while (it.hasNext()) { Local local = (Local) it.next(); createUDDUChain(local, useNodeOrStatement); } // end of going through all locals uses in statement /* * see if this is a def stmt in which case add an empty entry into the dU chain * * The wisdowm behind this is that later on when this definition is used we will use this arraylist to store the uses of * this definition */ if (s instanceof DefinitionStmt) { // check if dU doesnt already have something for this if (dU.get(s) == null) { dU.put(s, new ArrayList()); } } }
public void checkStatementUses(Stmt s, Object useNodeOrStatement) { List useBoxes = s.getUseBoxes(); // remeber getUsesFromBoxes returns both Locals and FieldRefs List<Value> uses = getUsesFromBoxes(useBoxes); Iterator<Value> it = uses.iterator(); while (it.hasNext()) { Value temp = it.next(); if (temp instanceof Local) { addLocalUse((Local) temp, useNodeOrStatement); } else if (temp instanceof FieldRef) { FieldRef field = (FieldRef) temp; SootField sootField = field.getField(); addFieldUse(sootField, useNodeOrStatement); } } }
public void inASTForLoopNode(ASTForLoopNode node) { // checking uses in init for (AugmentedStmt as : node.getInit()) { Stmt s = as.get_Stmt(); Iterator tempIt = s.getUseBoxes().iterator(); while (tempIt.hasNext()) { ValueBox tempBox = (ValueBox) tempIt.next(); // System.out.println("Checking useBox of init stmt"); checkAndSwitch(tempBox); } } // checking uses in condition ASTCondition cond = node.get_Condition(); checkConditionalUses(cond, node); // checking uses in update for (AugmentedStmt as : node.getUpdate()) { Stmt s = as.get_Stmt(); Iterator tempIt = s.getUseBoxes().iterator(); while (tempIt.hasNext()) { ValueBox tempBox = (ValueBox) tempIt.next(); // System.out.println("Checking useBox of update stmt"); checkAndSwitch(tempBox); } } }
s.addTag(new StringTag("Live Variable: " + v, "Live Variable")); Iterator usesIt = s.getUseBoxes().iterator(); while (usesIt.hasNext()) { ValueBox use = (ValueBox) usesIt.next();
logger.debug("s : " + s + " use boxes: " + s.getUseBoxes() + " def boxes: " + s.getDefBoxes()); Iterator useBoxesIt = s.getUseBoxes().iterator(); boolean result = true; uses: while (useBoxesIt.hasNext()) {
for (ValueBox box : curStmt.getUseBoxes()) { Value used = box.getValue(); if (aliasingLocals.contains(used)) {
public void inASTStatementSequenceNode(ASTStatementSequenceNode node) { for (AugmentedStmt as : node.getStatements()) { Stmt s = as.get_Stmt(); List useBoxes = s.getUseBoxes(); Object obj = cp.getBeforeSet(s); if (obj == null) { continue; } if (!(obj instanceof CPFlowSet)) { continue; } // before set is a non null CPFlowSet CPFlowSet beforeSet = (CPFlowSet) obj; // System.out.println("Statement: "+s); // System.out.println("Before set is: "+beforeSet.toString()); /* * get all use boxes see if their value is determined from the before set if yes replace them */ substituteUses(useBoxes, beforeSet); } }
for (Iterator<Unit> sIt = m.getActiveBody().getUnits().iterator(); sIt.hasNext();) { final Stmt s = (Stmt) sIt.next(); for (Iterator<ValueBox> bIt = s.getUseBoxes().iterator(); bIt.hasNext();) { final ValueBox b = bIt.next(); Value v = b.getValue();
List<ValueBox> useBoxes = s.getUseBoxes(); for (ValueBox useBox : useBoxes) { Value val = useBox.getValue();
Stmt s = (Stmt) it.next(); Iterator<ValueBox> usesIt = s.getUseBoxes().iterator(); FlowSet beforeSet = (FlowSet) analysis.getFlowBefore(s);
List useBoxes = s.getUseBoxes(); Stmt s = as.get_Stmt(); List useBoxes = s.getUseBoxes();
for (final ValueBox box : between.getUseBoxes()) { if (between == use && box == useBox) {
Iterator valBoxIt = s.getUseBoxes().iterator();
useBoxesIt = newStmt.getUseBoxes().iterator(); while (useBoxesIt.hasNext()) { ValueBox b = (useBoxesIt.next());
for (ValueBox box : nextNextStmt.getUseBoxes()) { if (box.getValue() == lvalue) { if (!foundExactlyOnce) {
boxIt = s.getUseBoxes().iterator(); while (boxIt.hasNext()) { ValueBox vBox = (ValueBox) boxIt.next();
Stmt stmt = (Stmt) stmtIt.next(); for (ValueBox useBox : stmt.getUseBoxes()) { if (useBox.getValue() instanceof Local) { Local l = (Local) useBox.getValue();
someCopyStmtModified = true; List useBoxes = s.getUseBoxes(); if (DEBUG) { System.out.println("Printing uses for stmt" + useBoxes);
for (ValueBox usebox : s.getUseBoxes()) { Value value = usebox.getValue(); if (!(value instanceof Local)) {