use of soot.toolkits.graph.TrapUnitGraph in project soot by Sable.
the class AugmentedStmtGraph method mirror_PredsSuccs.
private void mirror_PredsSuccs(AugmentedStmt as, UnitGraph ug) {
Stmt s = as.get_Stmt();
LinkedList<AugmentedStmt> preds = new LinkedList<AugmentedStmt>(), succs = new LinkedList<AugmentedStmt>();
// mirror the predecessors
for (Unit u : ug.getPredsOf(s)) {
AugmentedStmt po = get_AugStmt((Stmt) u);
if (preds.contains(po) == false)
preds.add(po);
}
// mirror the successors
for (Unit u : ug.getSuccsOf(s)) {
AugmentedStmt so = get_AugStmt((Stmt) u);
if (succs.contains(so) == false)
succs.add(so);
}
// attach the mirrors properly to the AugmentedStmt
if (ug instanceof BriefUnitGraph) {
as.bpreds = preds;
as.bsuccs = succs;
if (preds.size() == 0)
bheads.add(as);
if (succs.size() == 0)
btails.add(as);
} else if (ug instanceof TrapUnitGraph) {
as.cpreds = preds;
as.csuccs = succs;
if (preds.size() == 0)
cheads.add(as);
if (succs.size() == 0)
ctails.add(as);
} else
throw new RuntimeException("Unknown UnitGraph type: " + ug.getClass());
}
Aggregations