@Override final public Unit getDefaultTarget() { return defaultTargetBox.getUnit(); }
public Unit getEndUnit() { return endUnitBox.getUnit(); }
@Override final public Unit getTarget(int index) { return targetBoxes[index].getUnit(); }
@Override public Stmt getTarget() { return (Stmt) targetBox.getUnit(); }
public Unit getDefaultTarget() { return defaultTargetBox.getUnit(); }
public Unit getTarget(int index) { return targetBoxes[index].getUnit(); }
public Unit getTarget(int index) { return targetBoxes[index].getUnit(); }
public Unit getTarget() { return targetBox.getUnit(); }
public Unit getHandlerUnit() { return handlerUnitBox.getUnit(); }
public Unit getTarget() { return targetBox.getUnit(); }
public Unit getBeginUnit() { return beginUnitBox.getUnit(); }
public Unit getDefaultTarget() { return defaultTargetBox.getUnit(); }
@Override final public List<Unit> getTargets() { List<Unit> targets = new ArrayList<Unit>(); for (UnitBox element : targetBoxes) { targets.add(element.getUnit()); } return targets; }
public List getTargets() { List targets = new ArrayList(); for (UnitBox element : targetBoxes) { targets.add(element.getUnit()); } return targets; }
public List getTargets() { List targets = new ArrayList(); for (UnitBox element : targetBoxes) { targets.add(element.getUnit()); } return targets; }
@Override /** Verifies that the UnitBoxes of this Body all point to a Unit contained within this body. */ public void validate(Body body, List<ValidationException> exception) { for (UnitBox ub : body.getAllUnitBoxes()) { if (!body.getUnits().contains(ub.getUnit())) { throw new RuntimeException( "Unitbox points outside unitChain! to unit : " + ub.getUnit() + " in " + body.getMethod()); } } }
@Override public void redirectJumpsToThisTo(Unit newLocation) { List<UnitBox> boxesPointing = getBoxesPointingToThis(); UnitBox[] boxes = boxesPointing.toArray(new UnitBox[boxesPointing.size()]); // important to change this to an array to have a static copy for (UnitBox element : boxes) { UnitBox box = element; if (box.getUnit() != this) { throw new RuntimeException("Something weird's happening"); } if (box.isBranchTarget()) { box.setUnit(newLocation); } } } }
@Override public boolean isBranchTarget(Unit u, Unit succ) { assert getSuccsOf(u).contains(succ); if (!u.branches()) { return false; } for (UnitBox ub : u.getUnitBoxes()) { if (ub.getUnit() == succ) { return true; } } return false; }