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 class
AstTranslator.IncipientCFG.Unwind
-
Constructor Summary
Constructors Constructor Description IncipientCFG()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEdge(AstTranslator.PreBasicBlock src, AstTranslator.PreBasicBlock dst)
void
addInstruction(SSAInstruction n)
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.void
addPreEdge(CAstNode src, CAstNode dst, boolean exception)
void
addPreEdgeToExit(AstTranslator.PreBasicBlock src, boolean exception)
void
addPreEdgeToExit(CAstNode src, boolean exception)
void
addPreNode(CAstNode n)
void
addPreNode(CAstNode n, AstTranslator.UnwindState context)
associate n with the current block, and update the current unwind stateAstTranslator.PreBasicBlock
getBlock(CAstNode n)
AstTranslator.PreBasicBlock
getCurrentBlock()
int
getCurrentInstruction()
boolean
isDeadBlock(AstTranslator.PreBasicBlock block)
AstTranslator.PreBasicBlock
newBlock(boolean fallThruFromPrior)
create a new basic block, and set it as the current block.String
toString()
-
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:
addEdge
in interfaceEdgeManager<AstTranslator.PreBasicBlock>
- Overrides:
addEdge
in 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:
toString
in classAbstractGraph<AstTranslator.PreBasicBlock>
-
-