Package soot.toolkits.graph
Class ArrayRefBlockGraph
- java.lang.Object
-
- soot.toolkits.graph.BlockGraph
-
- soot.toolkits.graph.ArrayRefBlockGraph
-
- All Implemented Interfaces:
Iterable<Block>,DirectedBodyGraph<Block>,DirectedGraph<Block>
public class ArrayRefBlockGraph extends BlockGraph
-
-
Constructor Summary
Constructors Constructor Description ArrayRefBlockGraph(Body body)Constructs anArrayRefBlockGraphfrom the givenBody.ArrayRefBlockGraph(BriefUnitGraph unitGraph)Constructs an ArrayRefBlockGraph corresponding to the Unit-level control flow represented by the passedBriefUnitGraph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<Unit>computeLeaders(UnitGraph unitGraph)-
Methods inherited from class soot.toolkits.graph.BlockGraph
buildBlocks, getBlocks, getBody, getHeads, getPredsOf, getSuccsOf, getTails, iterator, size, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
ArrayRefBlockGraph
public ArrayRefBlockGraph(Body body)
Constructs an
ArrayRefBlockGraphfrom the givenBody.Note that this constructor builds a
BriefUnitGraphinternally when splitting body'sUnits intoBlocks. Callers who need both aBriefUnitGraphand anArrayRefBlockGraphshould use the constructor taking the BriefUnitGraph as a parameter, as a minor optimization.- Parameters:
body- the Body instance from which the graph is built.
-
ArrayRefBlockGraph
public ArrayRefBlockGraph(BriefUnitGraph unitGraph)
Constructs an ArrayRefBlockGraph corresponding to the Unit-level control flow represented by the passedBriefUnitGraph.- Parameters:
unitGraph- The BriefUnitGraph for which to build an ArrayRefBlockGraph.
-
-
Method Detail
-
computeLeaders
protected Set<Unit> computeLeaders(UnitGraph unitGraph)
Utility method for computing the basic block leaders for a
Body, given itsUnitGraph(i.e., the instructions which begin new basic blocks).This implementation chooses as block leaders all the Units that {@link BlockGraph.computerLeaders()}, and adds:
- All Units which contain an array reference, as defined by {@link Stmt.containsArrayRef()} and {@link Inst.containsArrayRef()}.
- The first Unit not covered by each
Trap(i.e., the Unit returned by {@link Trap.getLastUnit()}.
- Overrides:
computeLeadersin classBlockGraph- Parameters:
unitGraph- is the Unit-level CFG which is to be split into basic blocks.- Returns:
- the
SetofUnits in unitGraph which are block leaders.
-
-