1 19 20 25 26 27 package soot.toolkits.graph; 28 29 import java.util.*; 30 import java.io.*; 31 import soot.*; 32 import soot.jimple.Stmt; 33 import soot.baf.Inst; 34 35 36 43 public class ArrayRefBlockGraph extends BlockGraph 44 { 45 58 public ArrayRefBlockGraph(Body body) 59 { 60 this(new BriefUnitGraph(body)); 61 } 62 63 64 72 public ArrayRefBlockGraph(BriefUnitGraph unitGraph) 73 { 74 super(unitGraph); 75 76 soot.util.PhaseDumper.v().dumpGraph(this, mBody); 77 } 78 79 80 106 protected Set computeLeaders(UnitGraph unitGraph) { 107 Body body = unitGraph.getBody(); 108 if (body != mBody) { 109 throw new RuntimeException ("ArrayRefBlockGraph.computeLeaders() called with a UnitGraph that doesn't match its mBody."); 110 } 111 Set leaders = super.computeLeaders(unitGraph); 112 113 for (Iterator it = body.getUnits().iterator(); it.hasNext(); ) { 114 Unit unit = (Unit) it.next(); 115 if (((unit instanceof Stmt) && ((Stmt) unit).containsArrayRef()) || 116 ((unit instanceof Inst) && ((Inst) unit).containsArrayRef())) { 117 leaders.add(unit); 118 } 119 } 120 return leaders; 121 } 122 } 123 124 125 | Popular Tags |