1 19 20 25 26 27 package soot.toolkits.graph; 28 29 import java.util.*; 30 import java.io.*; 31 import soot.*; 32 33 34 46 47 public class ZonedBlockGraph extends BlockGraph 48 { 49 63 public ZonedBlockGraph(Body body) 64 { 65 this(new BriefUnitGraph(body)); 66 } 67 68 69 77 public ZonedBlockGraph(BriefUnitGraph unitGraph) 78 { 79 super(unitGraph); 80 81 soot.util.PhaseDumper.v().dumpGraph(this, mBody); 82 } 83 84 85 86 111 protected Set computeLeaders(UnitGraph unitGraph) { 112 Body body = unitGraph.getBody(); 113 if (body != mBody) { 114 throw new RuntimeException ("ZonedBlockGraph.computeLeaders() called with a UnitGraph that doesn't match its mBody."); 115 } 116 117 Set leaders = super.computeLeaders(unitGraph); 118 119 for (Iterator it = body.getTraps().iterator(); it.hasNext(); ) { 120 Trap trap = (Trap) it.next(); 121 leaders.add(trap.getBeginUnit()); 122 leaders.add(trap.getEndUnit()); 123 } 124 return leaders; 125 } 126 } 127 | Popular Tags |