public void caseLocal(final Local v) { ((ConvertToBaf) rvalue).convertToBaf(context, out); /* * Add the tags to the statement that COMPUTES the value, NOT to the statement that stores it. */ /* * No: the convertToBaf on the rvalue already adds them, so no need to add them here. However, with the current * semantics, we should add them to every statement and let the aggregator sort them out. */ Unit u = Baf.v().newStoreInst(v.getType(), context.getBafLocalOfJimpleLocal(v)); u.addAllTagsOf(JAssignStmt.this); out.add(u); }
Unit store = Baf.v().newStoreInst(IntType.v(), controlLocal);
Unit store = Baf.v().newStoreInst(t, l); units.insertAfter(store, after);
public void convertToBaf(JimpleToBafContext context, List<Unit> out) { Value currentRhs = getRightOp(); Value newRhs; if (currentRhs instanceof ThisRef) { newRhs = Baf.v().newThisRef((RefType) ((ThisRef) currentRhs).getType()); } else if (currentRhs instanceof ParameterRef) { newRhs = Baf.v().newParameterRef(((ParameterRef) currentRhs).getType(), ((ParameterRef) currentRhs).getIndex()); } else if (currentRhs instanceof CaughtExceptionRef) { Unit u = Baf.v().newStoreInst(RefType.v(), context.getBafLocalOfJimpleLocal((Local) getLeftOp())); u.addAllTagsOf(this); out.add(u); return; } else { throw new RuntimeException("Don't know how to convert unknown rhs"); } Unit u = Baf.v().newIdentityInst(context.getBafLocalOfJimpleLocal((Local) getLeftOp()), newRhs); u.addAllTagsOf(this); out.add(u); }
bLocals.add(nloc); if (first != null) { u.insertAfter(Baf.v().newStoreInst(LongType.v(), nloc), first); u.insertAfter(Baf.v().newPushInst(LongConstant.v(0)), first); } else { u.addFirst(Baf.v().newStoreInst(LongType.v(), nloc)); u.addFirst(Baf.v().newPushInst(LongConstant.v(0))); u.insertBefore(Baf.v().newAndInst(LongType.v()), unit); u.insertBefore(Baf.v().newXorInst(LongType.v()), unit); u.insertBefore(Baf.v().newStoreInst(LongType.v(), nloc), unit); u.remove(unit); u.insertBefore(Baf.v().newAndInst(LongType.v()), unit); u.insertBefore(Baf.v().newXorInst(LongType.v()), unit); u.insertBefore(Baf.v().newStoreInst(LongType.v(), nloc), unit); u.remove(unit);
Unit storZero = Baf.v().newStoreInst(IntType.v(), controlLocal); locs.add(varLocal); varsToLoad.push(varLocal); units.add(Baf.v().newStoreInst(type, varLocal)); units.insertBeforeNoRedirect(Baf.v().newStoreInst(type, varLocal), first); units.insertBeforeNoRedirect(Baf.v().newStoreInst(IntType.v(), controlLocal), begUnit); } else { units.insertBeforeNoRedirect(Baf.v().newIncInst(controlLocal, IntConstant.v(Rand.getInt(3) + 1)), begUnit);