public class SSACFG extends Object implements ControlFlowGraph<SSAInstruction,ISSABasicBlock>
ControlFlowGraph which stores the structure. This decision from 2004 may have been
premature optimization, left over from a world where IRs and related structures were long-lived. In today's system, they
are cached and reconstituted by SSACache. Perhaps we should just extend AbstractCFG and not worry so much about
space.
As the current implementation stands, the delegate graph stores the graph structure, and this class additionally stores
SSACFG.BasicBlocks and the SSAInstruction array.| Modifier and Type | Class and Description |
|---|---|
class |
SSACFG.BasicBlock
A Basic Block in an SSA IR
|
class |
SSACFG.ExceptionHandlerBasicBlock |
| Modifier and Type | Field and Description |
|---|---|
protected AbstractCFG<com.ibm.wala.shrikeBT.IInstruction,IBasicBlock<com.ibm.wala.shrikeBT.IInstruction>> |
delegate
A delegate CFG, pre-built, which stores the graph structure of this CFG.
|
protected SSAInstruction[] |
instructions
The "normal" instructions which constitute the SSA form.
|
protected IMethod |
method
The
IMethod this ControlFlowGraph represents |
| Constructor and Description |
|---|
SSACFG(IMethod method,
AbstractCFG cfg,
SSAInstruction[] instructions) |
protected final SSAInstruction[] instructions
SSAPhiInstructions, which dwell in
SSACFG.BasicBlocks instead.protected final IMethod method
IMethod this ControlFlowGraph representsprotected final AbstractCFG<com.ibm.wala.shrikeBT.IInstruction,IBasicBlock<com.ibm.wala.shrikeBT.IInstruction>> delegate
public SSACFG(IMethod method, AbstractCFG cfg, SSAInstruction[] instructions)
IllegalArgumentException - if method is nullpublic SSACFG.BasicBlock getBlockForInstruction(int instructionIndex)
getBlockForInstruction in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>instructionIndex - an instruction indexpublic SSAInstruction[] getInstructions()
getInstructions in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>public com.ibm.wala.util.intset.BitVector getCatchBlocks()
getCatchBlocks in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>public boolean isCatchBlock(int i)
public SSACFG.BasicBlock entry()
ControlFlowGraphentry in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>public SSACFG.BasicBlock exit()
exit in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>public int getNumber(ISSABasicBlock b) throws IllegalArgumentException
getNumber in interface com.ibm.wala.util.graph.NumberedNodeManager<ISSABasicBlock>IllegalArgumentExceptionpublic SSACFG.BasicBlock getNode(int number)
getNode in interface com.ibm.wala.util.graph.NumberedNodeManager<ISSABasicBlock>public int getMaxNumber()
getMaxNumber in interface com.ibm.wala.util.graph.NumberedNodeManager<ISSABasicBlock>public Iterator<ISSABasicBlock> iterator()
iterator in interface com.ibm.wala.util.graph.NodeManager<ISSABasicBlock>iterator in interface Iterable<ISSABasicBlock>public int getNumberOfNodes()
getNumberOfNodes in interface com.ibm.wala.util.graph.NodeManager<ISSABasicBlock>public Iterator<ISSABasicBlock> getPredNodes(ISSABasicBlock b) throws IllegalArgumentException
getPredNodes in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>IllegalArgumentExceptionpublic int getPredNodeCount(ISSABasicBlock b) throws IllegalArgumentException
getPredNodeCount in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>IllegalArgumentExceptionpublic Iterator<ISSABasicBlock> getSuccNodes(ISSABasicBlock b) throws IllegalArgumentException
getSuccNodes in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>IllegalArgumentExceptionpublic int getSuccNodeCount(ISSABasicBlock b) throws IllegalArgumentException
getSuccNodeCount in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>IllegalArgumentExceptionpublic void addNode(ISSABasicBlock n) throws UnsupportedOperationException
addNode in interface com.ibm.wala.util.graph.NodeManager<ISSABasicBlock>UnsupportedOperationExceptionpublic void addEdge(ISSABasicBlock src, ISSABasicBlock dst) throws UnsupportedOperationException
addEdge in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>UnsupportedOperationExceptionpublic void removeEdge(ISSABasicBlock src, ISSABasicBlock dst) throws UnsupportedOperationException
removeEdge in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>UnsupportedOperationExceptionpublic void removeAllIncidentEdges(ISSABasicBlock node) throws UnsupportedOperationException
removeAllIncidentEdges in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>UnsupportedOperationExceptionpublic void removeNodeAndEdges(ISSABasicBlock N) throws UnsupportedOperationException
removeNodeAndEdges in interface com.ibm.wala.util.graph.Graph<ISSABasicBlock>UnsupportedOperationExceptionpublic void removeNode(ISSABasicBlock n) throws UnsupportedOperationException
removeNode in interface com.ibm.wala.util.graph.NodeManager<ISSABasicBlock>UnsupportedOperationExceptionpublic int getProgramCounter(int index)
ControlFlowGraphgetProgramCounter in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>index - an instruction indexpublic boolean containsNode(ISSABasicBlock N)
containsNode in interface com.ibm.wala.util.graph.NodeManager<ISSABasicBlock>public IMethod getMethod()
getMethod in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>public List<ISSABasicBlock> getExceptionalSuccessors(ISSABasicBlock b)
ControlFlowGraphgetExceptionalSuccessors in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>public Collection<ISSABasicBlock> getExceptionalPredecessors(ISSABasicBlock b)
ControlFlowGraphgetExceptionalPredecessors in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>public boolean hasExceptionalEdge(SSACFG.BasicBlock src, SSACFG.BasicBlock dest)
IllegalArgumentException - if dest is nullpublic boolean hasNormalEdge(SSACFG.BasicBlock src, SSACFG.BasicBlock dest)
IllegalArgumentException - if dest is nullpublic Collection<ISSABasicBlock> getNormalSuccessors(ISSABasicBlock b)
ControlFlowGraphgetNormalSuccessors in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>public Collection<ISSABasicBlock> getNormalPredecessors(ISSABasicBlock b)
ControlFlowGraphgetNormalPredecessors in interface ControlFlowGraph<SSAInstruction,ISSABasicBlock>public Iterator<ISSABasicBlock> iterateNodes(com.ibm.wala.util.intset.IntSet s)
iterateNodes in interface com.ibm.wala.util.graph.NumberedNodeManager<ISSABasicBlock>public void removeIncomingEdges(ISSABasicBlock node) throws UnsupportedOperationException
removeIncomingEdges in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>UnsupportedOperationExceptionpublic void removeOutgoingEdges(ISSABasicBlock node) throws UnsupportedOperationException
removeOutgoingEdges in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>UnsupportedOperationExceptionpublic boolean hasEdge(ISSABasicBlock src, ISSABasicBlock dst) throws com.ibm.wala.util.debug.UnimplementedError
hasEdge in interface com.ibm.wala.util.graph.EdgeManager<ISSABasicBlock>com.ibm.wala.util.debug.UnimplementedErrorpublic com.ibm.wala.util.intset.IntSet getSuccNodeNumbers(ISSABasicBlock b) throws IllegalArgumentException
getSuccNodeNumbers in interface com.ibm.wala.util.graph.NumberedEdgeManager<ISSABasicBlock>IllegalArgumentExceptionpublic com.ibm.wala.util.intset.IntSet getPredNodeNumbers(ISSABasicBlock node) throws com.ibm.wala.util.debug.UnimplementedError
getPredNodeNumbers in interface com.ibm.wala.util.graph.NumberedEdgeManager<ISSABasicBlock>com.ibm.wala.util.debug.UnimplementedErrorpublic SSACFG.BasicBlock getBasicBlock(int bb)
Copyright © 2015. All rights reserved.