|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.ssa.SSACFG
public class SSACFG
A control-flow graph for ssa form.
| Nested Class Summary | |
|---|---|
class |
SSACFG.BasicBlock
A Basic Block in an SSA IR |
class |
SSACFG.ExceptionHandlerBasicBlock
|
| Field Summary | |
|---|---|
protected AbstractCFG<IBasicBlock> |
cfg
|
protected SSAInstruction[] |
instructions
|
protected IMethod |
method
|
| Constructor Summary | |
|---|---|
|
SSACFG(IMethod method,
AbstractCFG cfg,
SSAInstruction[] instructions)
|
protected |
SSACFG(SSACFG aCFG)
|
| Method Summary | |
|---|---|
void |
addEdge(ISSABasicBlock src,
ISSABasicBlock dst)
|
void |
addNode(ISSABasicBlock n)
add a node to this graph |
boolean |
containsNode(ISSABasicBlock N)
|
SSACFG.BasicBlock |
entry()
Return the entry basic block in the CFG |
boolean |
equals(java.lang.Object o)
|
SSACFG.BasicBlock |
exit()
|
SSACFG.BasicBlock |
getBasicBlock(int bb)
|
SSACFG.BasicBlock |
getBlockForInstruction(int instructionIndex)
Get the basic block an instruction belongs to. |
BitVector |
getCatchBlocks()
|
java.util.Collection<ISSABasicBlock> |
getExceptionalPredecessors(ISSABasicBlock b)
The order of blocks returned should be arbitrary but deterministic. |
java.util.List<ISSABasicBlock> |
getExceptionalSuccessors(ISSABasicBlock b)
The order of blocks returned must indicate the exception-handling scope. |
SSAInstruction[] |
getInstructions()
NB: Use iterators such as IR.iterateAllInstructions() instead of this method. |
int |
getMaxNumber()
|
IMethod |
getMethod()
|
SSACFG.BasicBlock |
getNode(int number)
|
java.util.Collection<ISSABasicBlock> |
getNormalPredecessors(ISSABasicBlock b)
The order of blocks returned should be arbitrary but deterministic. |
java.util.Collection<ISSABasicBlock> |
getNormalSuccessors(ISSABasicBlock b)
The order of blocks returned should be arbitrary but deterministic. |
int |
getNumber(ISSABasicBlock b)
|
int |
getNumberOfNodes()
|
int |
getPredNodeCount(ISSABasicBlock b)
Return the number of immediate predecessor
nodes of this Node
in the Graph. |
IntSet |
getPredNodeNumbers(ISSABasicBlock node)
|
java.util.Iterator<ISSABasicBlock> |
getPredNodes(ISSABasicBlock b)
Return an Iterator over the immediate predecessor nodes of this Node
in the Graph. |
int |
getProgramCounter(int index)
TODO: move this into IR? |
int |
getSuccNodeCount(ISSABasicBlock b)
Return the number of immediate successor
nodes of this Node
in the Graph |
IntSet |
getSuccNodeNumbers(ISSABasicBlock b)
|
java.util.Iterator<ISSABasicBlock> |
getSuccNodes(ISSABasicBlock b)
Return an Iterator over the immediate successor nodes of this Node in
the Graph |
boolean |
hasEdge(ISSABasicBlock src,
ISSABasicBlock dst)
|
boolean |
hasExceptionalEdge(SSACFG.BasicBlock src,
SSACFG.BasicBlock dest)
has exceptional edge src -> dest |
int |
hashCode()
|
boolean |
hasNormalEdge(SSACFG.BasicBlock src,
SSACFG.BasicBlock dest)
has normal edge src -> dest |
boolean |
isCatchBlock(int i)
is the given i a catch block? |
java.util.Iterator<ISSABasicBlock> |
iterateNodes(IntSet s)
|
java.util.Iterator<ISSABasicBlock> |
iterator()
|
void |
removeAllIncidentEdges(ISSABasicBlock node)
|
void |
removeEdge(ISSABasicBlock src,
ISSABasicBlock dst)
|
void |
removeIncomingEdges(ISSABasicBlock node)
|
void |
removeNode(ISSABasicBlock n)
remove a node from this graph |
void |
removeNodeAndEdges(ISSABasicBlock N)
remove a node and all its incident edges |
void |
removeOutgoingEdges(ISSABasicBlock node)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final SSAInstruction[] instructions
protected final IMethod method
protected final AbstractCFG<IBasicBlock> cfg
| Constructor Detail |
|---|
protected SSACFG(SSACFG aCFG)
public SSACFG(IMethod method,
AbstractCFG cfg,
SSAInstruction[] instructions)
java.lang.IllegalArgumentException - if method is null| Method Detail |
|---|
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic SSACFG.BasicBlock getBlockForInstruction(int instructionIndex)
getBlockForInstruction in interface ControlFlowGraph<ISSABasicBlock>instructionIndex - an instruction index
public SSAInstruction[] getInstructions()
getInstructions in interface ControlFlowGraph<ISSABasicBlock>public java.lang.String toString()
toString in class java.lang.Objectpublic BitVector getCatchBlocks()
getCatchBlocks in interface ControlFlowGraph<ISSABasicBlock>public boolean isCatchBlock(int i)
public SSACFG.BasicBlock entry()
ControlFlowGraph
entry in interface ControlFlowGraph<ISSABasicBlock>public SSACFG.BasicBlock exit()
exit in interface ControlFlowGraph<ISSABasicBlock>
public int getNumber(ISSABasicBlock b)
throws java.lang.IllegalArgumentException
getNumber in interface NumberedNodeManager<ISSABasicBlock>java.lang.IllegalArgumentExceptionpublic SSACFG.BasicBlock getNode(int number)
getNode in interface NumberedNodeManager<ISSABasicBlock>public int getMaxNumber()
getMaxNumber in interface NumberedNodeManager<ISSABasicBlock>public java.util.Iterator<ISSABasicBlock> iterator()
iterator in interface NodeManager<ISSABasicBlock>iterator in interface java.lang.Iterable<ISSABasicBlock>public int getNumberOfNodes()
getNumberOfNodes in interface NodeManager<ISSABasicBlock>
public java.util.Iterator<ISSABasicBlock> getPredNodes(ISSABasicBlock b)
throws java.lang.IllegalArgumentException
EdgeManagernodes of this Node
in the Graph.
This method never returns null.
getPredNodes in interface EdgeManager<ISSABasicBlock>java.lang.IllegalArgumentException
public int getPredNodeCount(ISSABasicBlock b)
throws java.lang.IllegalArgumentException
EdgeManagerimmediate predecessor
nodes of this Node
in the Graph.
getPredNodeCount in interface EdgeManager<ISSABasicBlock>java.lang.IllegalArgumentException
public java.util.Iterator<ISSABasicBlock> getSuccNodes(ISSABasicBlock b)
throws java.lang.IllegalArgumentException
EdgeManagernodes of this Node in
the Graph
This method never returns null.
getSuccNodes in interface EdgeManager<ISSABasicBlock>java.lang.IllegalArgumentException
public int getSuccNodeCount(ISSABasicBlock b)
throws java.lang.IllegalArgumentException
EdgeManagerimmediate successor
nodes of this Node
in the Graph
getSuccNodeCount in interface EdgeManager<ISSABasicBlock>java.lang.IllegalArgumentException
public void addNode(ISSABasicBlock n)
throws java.lang.UnsupportedOperationException
NodeManager
addNode in interface NodeManager<ISSABasicBlock>java.lang.UnsupportedOperationException
public void addEdge(ISSABasicBlock src,
ISSABasicBlock dst)
throws java.lang.UnsupportedOperationException
addEdge in interface EdgeManager<ISSABasicBlock>java.lang.UnsupportedOperationException
public void removeEdge(ISSABasicBlock src,
ISSABasicBlock dst)
throws java.lang.UnsupportedOperationException
removeEdge in interface EdgeManager<ISSABasicBlock>java.lang.UnsupportedOperationException
public void removeAllIncidentEdges(ISSABasicBlock node)
throws java.lang.UnsupportedOperationException
removeAllIncidentEdges in interface EdgeManager<ISSABasicBlock>java.lang.UnsupportedOperationException
public void removeNodeAndEdges(ISSABasicBlock N)
throws java.lang.UnsupportedOperationException
Graph
removeNodeAndEdges in interface Graph<ISSABasicBlock>java.lang.UnsupportedOperationException
public void removeNode(ISSABasicBlock n)
throws java.lang.UnsupportedOperationException
NodeManager
removeNode in interface NodeManager<ISSABasicBlock>java.lang.UnsupportedOperationExceptionpublic int getProgramCounter(int index)
ControlFlowGraph
getProgramCounter in interface ControlFlowGraph<ISSABasicBlock>index - an instruction index
public boolean containsNode(ISSABasicBlock N)
containsNode in interface NodeManager<ISSABasicBlock>public IMethod getMethod()
getMethod in interface ControlFlowGraph<ISSABasicBlock>public java.util.List<ISSABasicBlock> getExceptionalSuccessors(ISSABasicBlock b)
ControlFlowGraph
getExceptionalSuccessors in interface ControlFlowGraph<ISSABasicBlock>public java.util.Collection<ISSABasicBlock> getExceptionalPredecessors(ISSABasicBlock b)
ControlFlowGraph
getExceptionalPredecessors in interface ControlFlowGraph<ISSABasicBlock>
public boolean hasExceptionalEdge(SSACFG.BasicBlock src,
SSACFG.BasicBlock dest)
java.lang.IllegalArgumentException - if dest is null
public boolean hasNormalEdge(SSACFG.BasicBlock src,
SSACFG.BasicBlock dest)
java.lang.IllegalArgumentException - if dest is nullpublic java.util.Collection<ISSABasicBlock> getNormalSuccessors(ISSABasicBlock b)
ControlFlowGraph
getNormalSuccessors in interface ControlFlowGraph<ISSABasicBlock>public java.util.Collection<ISSABasicBlock> getNormalPredecessors(ISSABasicBlock b)
ControlFlowGraph
getNormalPredecessors in interface ControlFlowGraph<ISSABasicBlock>public java.util.Iterator<ISSABasicBlock> iterateNodes(IntSet s)
iterateNodes in interface NumberedNodeManager<ISSABasicBlock>
public void removeIncomingEdges(ISSABasicBlock node)
throws java.lang.UnsupportedOperationException
removeIncomingEdges in interface EdgeManager<ISSABasicBlock>java.lang.UnsupportedOperationException
public void removeOutgoingEdges(ISSABasicBlock node)
throws java.lang.UnsupportedOperationException
removeOutgoingEdges in interface EdgeManager<ISSABasicBlock>java.lang.UnsupportedOperationException
public boolean hasEdge(ISSABasicBlock src,
ISSABasicBlock dst)
throws UnimplementedError
hasEdge in interface EdgeManager<ISSABasicBlock>UnimplementedError
public IntSet getSuccNodeNumbers(ISSABasicBlock b)
throws java.lang.IllegalArgumentException
getSuccNodeNumbers in interface NumberedEdgeManager<ISSABasicBlock>java.lang.IllegalArgumentException
public IntSet getPredNodeNumbers(ISSABasicBlock node)
throws UnimplementedError
getPredNodeNumbers in interface NumberedEdgeManager<ISSABasicBlock>UnimplementedErrorpublic SSACFG.BasicBlock getBasicBlock(int bb)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||