public class PrunedCFG<I,T extends IBasicBlock<I>> extends AbstractNumberedGraph<T> implements ControlFlowGraph<I,T>
ControlFlowGraph
. Use this class along with an EdgeFilter
to produce a custom view of a CFG.
For example, you can use this class to produce a CFG view that ignores certain types of exceptional edges.Modifier and Type | Method and Description |
---|---|
T |
entry()
Return the entry basic block in the CFG
|
T |
exit() |
T |
getBlockForInstruction(int index) |
BitVector |
getCatchBlocks() |
protected NumberedEdgeManager<T> |
getEdgeManager() |
Collection<T> |
getExceptionalPredecessors(T N)
The order of blocks returned should be arbitrary but deterministic.
|
List<T> |
getExceptionalSuccessors(T N)
The order of blocks returned must indicate the exception-handling scope.
|
I[] |
getInstructions() |
IMethod |
getMethod() |
protected NumberedNodeManager<T> |
getNodeManager() |
Collection<T> |
getNormalPredecessors(T N)
The order of blocks returned should be arbitrary but deterministic.
|
Collection<T> |
getNormalSuccessors(T N)
The order of blocks returned should be arbitrary but deterministic.
|
IntSet |
getPhiIndices(T bb) |
int |
getProgramCounter(int index)
TODO: move this into IR?
|
static <I,T extends IBasicBlock<I>> |
make(ControlFlowGraph<I,T> cfg,
EdgeFilter<T> filter) |
getMaxNumber, getNode, getNumber, getPredNodeNumbers, getSuccNodeNumbers, iterateNodes
addEdge, addNode, containsNode, getNumberOfNodes, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, iterator, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
removeNodeAndEdges
getMaxNumber, getNode, getNumber, iterateNodes
addNode, containsNode, getNumberOfNodes, iterator, removeNode
forEach, spliterator
getPredNodeNumbers, getSuccNodeNumbers
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdges
public static <I,T extends IBasicBlock<I>> PrunedCFG<I,T> make(ControlFlowGraph<I,T> cfg, EdgeFilter<T> filter)
cfg
- the original CFG that you want a view offilter
- an object that selectively filters edges in the original CFGIllegalArgumentException
- if cfg is nullprotected NumberedNodeManager<T> getNodeManager()
getNodeManager
in class AbstractNumberedGraph<T extends IBasicBlock<I>>
protected NumberedEdgeManager<T> getEdgeManager()
getEdgeManager
in class AbstractNumberedGraph<T extends IBasicBlock<I>>
public List<T> getExceptionalSuccessors(T N)
ControlFlowGraph
getExceptionalSuccessors
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
public Collection<T> getNormalSuccessors(T N)
ControlFlowGraph
getNormalSuccessors
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
public Collection<T> getExceptionalPredecessors(T N)
ControlFlowGraph
getExceptionalPredecessors
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
public Collection<T> getNormalPredecessors(T N)
ControlFlowGraph
getNormalPredecessors
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
public T entry()
ControlFlowGraph
entry
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
public T exit()
exit
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
public T getBlockForInstruction(int index)
getBlockForInstruction
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
index
- an instruction indexpublic I[] getInstructions()
getInstructions
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
public int getProgramCounter(int index)
ControlFlowGraph
getProgramCounter
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
index
- an instruction indexpublic IMethod getMethod()
getMethod
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>
public BitVector getCatchBlocks()
getCatchBlocks
in interface ControlFlowGraph<I,T extends IBasicBlock<I>>