Package com.ibm.wala.cast.ir.translator
Class AstTranslator.IncipientCFG
- java.lang.Object
-
- com.ibm.wala.util.graph.AbstractGraph<T>
-
- com.ibm.wala.util.graph.AbstractNumberedGraph<T>
-
- com.ibm.wala.util.graph.impl.SparseNumberedGraph<AstTranslator.PreBasicBlock>
-
- com.ibm.wala.cast.ir.translator.AstTranslator.IncipientCFG
-
- All Implemented Interfaces:
EdgeManager<AstTranslator.PreBasicBlock>,Graph<AstTranslator.PreBasicBlock>,NodeManager<AstTranslator.PreBasicBlock>,NumberedEdgeManager<AstTranslator.PreBasicBlock>,NumberedGraph<AstTranslator.PreBasicBlock>,NumberedNodeManager<AstTranslator.PreBasicBlock>,Iterable<AstTranslator.PreBasicBlock>
- Enclosing class:
- AstTranslator
public final class AstTranslator.IncipientCFG extends SparseNumberedGraph<AstTranslator.PreBasicBlock>
holds the control-flow graph as it is being constructed. When construction is complete, information is stored in anAstTranslator.AstCFG
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAstTranslator.IncipientCFG.Unwind
-
Constructor Summary
Constructors Constructor Description IncipientCFG()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(AstTranslator.PreBasicBlock src, AstTranslator.PreBasicBlock dst)voidaddInstruction(SSAInstruction n)voidaddPreEdge(AstTranslator.PreBasicBlock src, CAstNode dst, boolean exception)if dst is associated with a basic block b, add an edge from src to b.voidaddPreEdge(CAstNode src, CAstNode dst, boolean exception)voidaddPreEdgeToExit(AstTranslator.PreBasicBlock src, boolean exception)voidaddPreEdgeToExit(CAstNode src, boolean exception)voidaddPreNode(CAstNode n)voidaddPreNode(CAstNode n, AstTranslator.UnwindState context)associate n with the current block, and update the current unwind stateAstTranslator.PreBasicBlockgetBlock(CAstNode n)AstTranslator.PreBasicBlockgetCurrentBlock()intgetCurrentInstruction()booleanisDeadBlock(AstTranslator.PreBasicBlock block)AstTranslator.PreBasicBlocknewBlock(boolean fallThruFromPrior)create a new basic block, and set it as the current block.StringtoString()-
Methods inherited from class com.ibm.wala.util.graph.impl.SparseNumberedGraph
getEdgeManager, getNodeManager
-
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
addNode, containsNode, getNumberOfNodes, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, iterator, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges
-
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
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
-
-
-
-
Method Detail
-
getCurrentInstruction
public int getCurrentInstruction()
-
getCurrentBlock
public AstTranslator.PreBasicBlock getCurrentBlock()
-
newBlock
public AstTranslator.PreBasicBlock newBlock(boolean fallThruFromPrior)
create a new basic block, and set it as the current block.- Parameters:
fallThruFromPrior- should a fall-through edge be added from the previous block (value of currentBlock at entry)? if false, the newly created block is marked as a dead block, as it has no incoming edges.- Returns:
- the new block
-
addPreNode
public void addPreNode(CAstNode n)
-
addPreNode
public void addPreNode(CAstNode n, AstTranslator.UnwindState context)
associate n with the current block, and update the current unwind state
-
addPreEdge
public void addPreEdge(AstTranslator.PreBasicBlock src, CAstNode dst, boolean exception)
if dst is associated with a basic block b, add an edge from src to b. otherwise, record the edge addition as delayed.
-
addPreEdgeToExit
public void addPreEdgeToExit(CAstNode src, boolean exception)
-
addPreEdgeToExit
public void addPreEdgeToExit(AstTranslator.PreBasicBlock src, boolean exception)
-
addEdge
public void addEdge(AstTranslator.PreBasicBlock src, AstTranslator.PreBasicBlock dst)
- Specified by:
addEdgein interfaceEdgeManager<AstTranslator.PreBasicBlock>- Overrides:
addEdgein classAbstractGraph<AstTranslator.PreBasicBlock>
-
isDeadBlock
public boolean isDeadBlock(AstTranslator.PreBasicBlock block)
-
getBlock
public AstTranslator.PreBasicBlock getBlock(CAstNode n)
-
addInstruction
public void addInstruction(SSAInstruction n)
-
toString
public String toString()
- Overrides:
toStringin classAbstractGraph<AstTranslator.PreBasicBlock>
-
-