Class DelegatingCFG<I,T extends IBasicBlock<I>>
java.lang.Object
com.ibm.wala.util.graph.AbstractGraph<T>
com.ibm.wala.util.graph.AbstractNumberedGraph<T>
com.ibm.wala.cast.ir.cfg.DelegatingCFG<I,T>
- All Implemented Interfaces:
ControlFlowGraph<I,
,T> MinimalCFG<T>
,EdgeManager<T>
,Graph<T>
,NodeManager<T>
,NumberedEdgeManager<T>
,NumberedGraph<T>
,NumberedNodeManager<T>
,Iterable<T>
public class DelegatingCFG<I,T extends IBasicBlock<I>>
extends AbstractNumberedGraph<T>
implements ControlFlowGraph<I,T>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionentry()
Return the entry basic block in the CFGexit()
getBlockForInstruction
(int index) protected NumberedEdgeManager
<T> The order of blocks returned should be arbitrary but deterministic.The order of blocks returned must indicate the exception-handling scope.I[]
protected NumberedNodeManager
<T> The order of blocks returned should be arbitrary but deterministic.The order of blocks returned should be arbitrary but deterministic.int
getProgramCounter
(int index) TODO: move this into IR?Methods inherited from class com.ibm.wala.util.graph.AbstractNumberedGraph
getMaxNumber, getNode, getNumber, getPredNodeNumbers, getSuccNodeNumbers, iterateNodes
Methods inherited from class com.ibm.wala.util.graph.AbstractGraph
addEdge, addNode, containsNode, edgeString, getNumberOfNodes, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, iterator, nodeString, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges, stream, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.ibm.wala.util.graph.EdgeManager
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdges
Methods inherited from interface com.ibm.wala.util.graph.Graph
removeNodeAndEdges
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.ibm.wala.util.graph.NodeManager
addNode, containsNode, getNumberOfNodes, iterator, removeNode, stream
Methods inherited from interface com.ibm.wala.util.graph.NumberedEdgeManager
getPredNodeNumbers, getSuccNodeNumbers
Methods inherited from interface com.ibm.wala.util.graph.NumberedNodeManager
getMaxNumber, getNode, getNumber, iterateNodes
-
Field Details
-
parent
-
-
Constructor Details
-
DelegatingCFG
-
-
Method Details
-
getNodeManager
- Specified by:
getNodeManager
in classAbstractNumberedGraph<T extends IBasicBlock<I>>
- Returns:
- the object which manages nodes in the graph
-
getEdgeManager
- Specified by:
getEdgeManager
in classAbstractNumberedGraph<T extends IBasicBlock<I>>
- Returns:
- the object which manages edges in the graph
-
entry
Description copied from interface:MinimalCFG
Return the entry basic block in the CFG- Specified by:
entry
in interfaceMinimalCFG<I>
-
exit
- Specified by:
exit
in interfaceMinimalCFG<I>
- Returns:
- the synthetic exit block for the cfg
-
getCatchBlocks
- Specified by:
getCatchBlocks
in interfaceControlFlowGraph<I,
T extends IBasicBlock<I>> - Returns:
- the indices of the catch blocks, as a bit vector
-
getBlockForInstruction
- Specified by:
getBlockForInstruction
in interfaceControlFlowGraph<I,
T extends IBasicBlock<I>> - Parameters:
index
- an instruction index- Returns:
- the basic block which contains this instruction.
-
getInstructions
- Specified by:
getInstructions
in interfaceControlFlowGraph<I,
T extends IBasicBlock<I>> - Returns:
- the instructions of this CFG, as an array.
-
getProgramCounter
public int getProgramCounter(int index) Description copied from interface:ControlFlowGraph
TODO: move this into IR?- Specified by:
getProgramCounter
in interfaceControlFlowGraph<I,
T extends IBasicBlock<I>> - Parameters:
index
- an instruction index- Returns:
- the program counter (bytecode index) corresponding to that instruction
-
getMethod
- Specified by:
getMethod
in interfaceControlFlowGraph<I,
T extends IBasicBlock<I>> - Returns:
- the Method this CFG represents
-
getExceptionalSuccessors
Description copied from interface:MinimalCFG
The order of blocks returned must indicate the exception-handling scope. So the first block is the first candidate catch block, and so on. With this invariant one can compute the exceptional control flow for a given exception type.- Specified by:
getExceptionalSuccessors
in interfaceMinimalCFG<I>
- Returns:
- the basic blocks which may be reached from b via exceptional control flow
-
getNormalSuccessors
Description copied from interface:MinimalCFG
The order of blocks returned should be arbitrary but deterministic.- Specified by:
getNormalSuccessors
in interfaceMinimalCFG<I>
- Returns:
- the basic blocks which may be reached from b via normal control flow
-
getExceptionalPredecessors
Description copied from interface:MinimalCFG
The order of blocks returned should be arbitrary but deterministic.- Specified by:
getExceptionalPredecessors
in interfaceMinimalCFG<I>
- Returns:
- the basic blocks from which b may be reached via exceptional control flow
-
getNormalPredecessors
Description copied from interface:MinimalCFG
The order of blocks returned should be arbitrary but deterministic.- Specified by:
getNormalPredecessors
in interfaceMinimalCFG<I>
- Returns:
- the basic blocks from which b may be reached via normal control flow
-