public class ClassicCompleteUnitGraph extends TrapUnitGraph
Represents a CFG for a Body instance where the nodes are
Unit
instances, and where edges are a conservative
indication of unexceptional and exceptional control
flow.
ClassicCompleteUnitGraph attempts to duplicate the
results that would have been produced by Soot's
CompleteUnitGraph
in releases up to Soot 2.1.0 (the
one known discrepancy is that the 2.1.0
CompleteUnitGraph
would include two edges joining one
node to another
Unit
s if the first node both branched to and fell through to
the second). It is included solely for testing purposes, and
should not be used in actual analyses.
There are two distinctions between the graphs produced by the ClassicCompleteUnitGraph and ExceptionalUnitGraph:
ThrowAnalysis
used to estimate
which exceptions each Unit
may throw.
ClassicCompleteUnitGraph creates edges for all trapped
Units, regardless of the types of exceptions they may
throw.body, heads, method, tails, unitChain, unitToPreds, unitToSuccs
Constructor and Description |
---|
ClassicCompleteUnitGraph(Body body)
Constructs the graph from a given Body instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buildExceptionalEdges(java.util.Map<Unit,java.util.List<Unit>> unitToSuccs,
java.util.Map<Unit,java.util.List<Unit>> unitToPreds)
Method to compute the edges corresponding to exceptional
control flow.
|
addEdge, buildHeadsAndTails, buildUnexceptionalEdges, combineMapValues, getBody, getExtendedBasicBlockPathBetween, getHeads, getPredsOf, getSuccsOf, getTails, iterator, size, toString
public ClassicCompleteUnitGraph(Body body)
the
- Body instance from which the graph is built.protected void buildExceptionalEdges(java.util.Map<Unit,java.util.List<Unit>> unitToSuccs, java.util.Map<Unit,java.util.List<Unit>> unitToPreds)
buildExceptionalEdges
in class TrapUnitGraph
unitToSuccs
- A Map
from Unit
s to List
s of Unit
s. This is * an ``out
parameter''; buildExceptionalEdges
will add a mapping for every Unit
within the scope of one or more Trap
s to a List of the handler
units of those Traps.unitToPreds
- A Map
from Unit
s to
List
s of Unit
s. This is an
``out parameter'';
buildExceptionalEdges will add a
mapping for every Trap
handler to
all the Units within the scope of
that Trap.