|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soot.toolkits.graph.BlockGraph soot.toolkits.graph.ExceptionalBlockGraph
public class ExceptionalBlockGraph
Represents a CFG where the nodes are Block
s and the
edges are derived from control flow. Control flow associated with
exceptions is taken into account: when a Unit
may throw
an exception that is caught by a Trap
within the
Body
, the excepting Unit
starts a new basic
block (Unit
s do not start a new block when all the exceptions
they might throw would escape the method without being caught).
Nested Class Summary | |
---|---|
static class |
ExceptionalBlockGraph.ExceptionDest
|
Field Summary |
---|
Fields inherited from class soot.toolkits.graph.BlockGraph |
---|
mBlocks, mBody, mHeads, mTails, mUnits |
Constructor Summary | |
---|---|
ExceptionalBlockGraph(Body body)
Constructs an ExceptionalBlockGraph for the
blocks found by partitioning the the units of the provided
Body instance into basic blocks. |
|
ExceptionalBlockGraph(ExceptionalUnitGraph unitGraph)
Constructs a graph for the blocks found by partitioning the the Unit s in an ExceptionalUnitGraph . |
Method Summary | |
---|---|
protected Map<Unit,Block> |
buildBlocks(Set<Unit> leaders,
UnitGraph uncastUnitGraph)
A utility method that does most of the work of constructing basic blocks, once the set of block leaders has been determined, and which designates the heads and tails of the graph. |
List<Block> |
getExceptionalPredsOf(Block b)
Returns a list of nodes which are predecessors of a given node when only exceptional control flow is considered. |
List<Block> |
getExceptionalSuccsOf(Block b)
Returns a list of nodes which are successors of a given node when only exceptional control flow is considered. |
Collection<ExceptionalBlockGraph.ExceptionDest> |
getExceptionDests(Block b)
Returns a collection of ExceptionDest
objects which represent how exceptions thrown by a specified
node will be handled. |
List<Block> |
getUnexceptionalPredsOf(Block b)
Returns a list of nodes which are predecessors of a given node when only unexceptional control flow is considered. |
List<Block> |
getUnexceptionalSuccsOf(Block b)
Returns a list of nodes which are successors of a given node when only unexceptional control flow is considered. |
Methods inherited from class soot.toolkits.graph.BlockGraph |
---|
computeLeaders, 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 soot.toolkits.graph.ExceptionalGraph |
---|
getBody |
Methods inherited from interface soot.toolkits.graph.DirectedGraph |
---|
getHeads, getPredsOf, getSuccsOf, getTails, iterator, size |
Constructor Detail |
---|
public ExceptionalBlockGraph(Body body)
Constructs an ExceptionalBlockGraph
for the
blocks found by partitioning the the units of the provided
Body
instance into basic blocks.
Note that this constructor builds an ExceptionalUnitGraph
internally when splitting body
's
Unit
s into Block
s. Callers who already have
an ExceptionalUnitGraph
to hand can use the constructor
taking an ExceptionalUnitGraph
as a parameter, as a
minor optimization.
body
- The underlying body we want to make a graph for.public ExceptionalBlockGraph(ExceptionalUnitGraph unitGraph)
Unit
s in an ExceptionalUnitGraph
.
unitGraph
- The ExceptionalUnitGraph
whose
Unit
s are to be split into blocks.Method Detail |
---|
protected Map<Unit,Block> buildBlocks(Set<Unit> leaders, UnitGraph uncastUnitGraph)
A utility method that does most of the work of constructing basic blocks, once the set of block leaders has been determined, and which designates the heads and tails of the graph.
BlockGraph
provides an implementation of
buildBlocks()
which splits the Unit
s in
unitGraph
so that each Unit
in the
passed set of block leaders is the first unit in a block. It
defines as heads the blocks which begin with
Unit
s which are heads in unitGraph
,
and defines as tails the blocks which end with
Unit
s which are tails in unitGraph
.
Subclasses might override this behavior.
This implementation calls the inherited implementation to split
units into blocks, before adding the distinctions between
exceptional and unexceptional control flow.
buildBlocks
in class BlockGraph
{@inheritDoc}
-
Map
from Unit
s which begin or end a block
to the block which contains them.public List<Block> getUnexceptionalPredsOf(Block b)
ExceptionalGraph
getUnexceptionalPredsOf
in interface ExceptionalGraph<Block>
b
- The node whose predecessors are to be returned.
List
of the nodes in this graph from which
there is an unexceptional edge to n
.public List<Block> getUnexceptionalSuccsOf(Block b)
ExceptionalGraph
getUnexceptionalSuccsOf
in interface ExceptionalGraph<Block>
b
- The node whose successors are to be returned.
List
of nodes in this graph to which
there is an unexceptional edge from n
.public List<Block> getExceptionalPredsOf(Block b)
ExceptionalGraph
getExceptionalPredsOf
in interface ExceptionalGraph<Block>
b
- The node whose predecessors are to be returned.
List
of nodes in this graph from which
there is an exceptional edge to n
.public List<Block> getExceptionalSuccsOf(Block b)
ExceptionalGraph
getExceptionalSuccsOf
in interface ExceptionalGraph<Block>
b
- The node whose successors are to be returned.
List
of nodes in this graph to which
there is an exceptional edge from n
.public Collection<ExceptionalBlockGraph.ExceptionDest> getExceptionDests(Block b)
ExceptionalGraph
ExceptionDest
objects which represent how exceptions thrown by a specified
node will be handled.
getExceptionDests
in interface ExceptionalGraph<Block>
b
- The node for which to provide exception information.
ExceptionDest
objects describing
the traps and handlers, if any, which catch the exceptions
which may be thrown by n
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |