Class AstTranslator.IncipientCFG
java.lang.Object
com.ibm.wala.util.graph.AbstractGraph<AstTranslator.PreBasicBlock>
com.ibm.wala.util.graph.AbstractNumberedGraph<AstTranslator.PreBasicBlock>
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 an
AstTranslator.AstCFG-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddPreEdge(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) voidvoidaddPreNode(CAstNode n, AstTranslator.UnwindState context) associate n with the current block, and update the current unwind stateintbooleannewBlock(boolean fallThruFromPrior) create a new basic block, and set it as the current block.voidnoteOperands(int instruction, CAstSourcePositionMap.Position... operands) voidtoString()voidMethods inherited from class SparseNumberedGraph
getEdgeManager, getNodeManagerModifier and TypeMethodDescriptionprotected NumberedEdgeManager<AstTranslator.PreBasicBlock> protected NumberedNodeManager<AstTranslator.PreBasicBlock> Methods inherited from class AbstractNumberedGraph
getMaxNumber, getNode, getNumber, getPredNodeNumbers, getSuccNodeNumbers, iterateNodesMethods inherited from class AbstractGraph
addNode, containsNode, edgeString, getNumberOfNodes, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, iterator, nodeString, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges, streamModifier and TypeMethodDescriptionvoidadd a node to this graphbooleanprotected StringintintReturn the number ofimmediate predecessornodes of nReturn anIteratorover the immediate predecessor nodes of nintReturn the number ofimmediate successornodes of this Node in the GraphReturn an Iterator over the immediate successor nodes of nbooleaniterator()protected StringnodeString(AstTranslator.PreBasicBlock n, boolean forEdge) voidvoidvoidvoidremove a node from this graphvoidremove a node and all its incident edgesvoidstream()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
IncipientCFG
public IncipientCFG()
-
-
Method Details
-
getCurrentInstruction
public int getCurrentInstruction() -
getCurrentBlock
-
newBlock
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
-
setCurrentBlockAsHandler
public void setCurrentBlockAsHandler() -
addPreNode
-
addPreNode
associate n with the current block, and update the current unwind state -
addPreEdge
-
addPreEdge
if dst is associated with a basic block b, add an edge from src to b. otherwise, record the edge addition as delayed. -
addPreEdgeToExit
-
addPreEdgeToExit
-
addEdge
- Specified by:
addEdgein interfaceEdgeManager<AstTranslator.PreBasicBlock>- Overrides:
addEdgein classAbstractGraph<AstTranslator.PreBasicBlock>- See Also:
-
isDeadBlock
-
getBlock
-
noteOperands
-
unknownInstructions
-
addInstruction
-
toString
- Overrides:
toStringin classAbstractGraph<AstTranslator.PreBasicBlock>
-
getOperandPositionMap
-