public class ControlFlowGraph extends Object implements AbstractControlFlowGraph<Block>
Modifier and Type | Field and Description |
---|---|
StructuredGraph |
graph |
private List<Loop<Block>> |
loops |
static double |
MIN_PROBABILITY
Don't allow probability values to be become too small as this makes frequency calculations
large enough that they can overflow the range of a double.
|
private NodeMap<Block> |
nodeToBlock |
private List<Block> |
reversePostOrder |
BLOCK_ID_INITIAL, BLOCK_ID_VISITED
Modifier | Constructor and Description |
---|---|
protected |
ControlFlowGraph(StructuredGraph graph) |
Modifier and Type | Method and Description |
---|---|
private static void |
addBranchToLoop(Loop<Block> l,
Block b) |
Block |
blockFor(Node node) |
private static Block |
commonPostdominator(Block a,
Block b) |
static ControlFlowGraph |
compute(StructuredGraph graph,
boolean connectBlocks,
boolean computeLoops,
boolean computeDominators,
boolean computePostdominators) |
private static void |
computeLoopBlocks(Block ablock,
Loop<Block> aloop) |
private void |
computeLoopInformation() |
void |
computePostdominators() |
private void |
connectBlocks() |
double |
frequencyFor(FixedNode node) |
List<Block> |
getBlocks()
Returns the list blocks contained in this control flow graph.
|
List<Loop<Block>> |
getLoops() |
NodeMap<Block> |
getNodeToBlock() |
Block |
getStartBlock() |
private void |
identifyBlock(Block block) |
private void |
identifyBlocks() |
Iterable<Block> |
postOrder() |
Iterable<Block> |
reversePostOrder() |
void |
setNodeToBlock(NodeMap<Block> nodeMap) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
calcDominatorRanges, commonDominator, commonDominatorHelper, commonDominatorRaw, commonDominatorRawSameDepth, commonDominatorTyped, computeDominators, dominates, isDominatedBy, strictlyDominates
public static final double MIN_PROBABILITY
public final StructuredGraph graph
private NodeMap<Block> nodeToBlock
private List<Block> reversePostOrder
protected ControlFlowGraph(StructuredGraph graph)
public static ControlFlowGraph compute(StructuredGraph graph, boolean connectBlocks, boolean computeLoops, boolean computeDominators, boolean computePostdominators)
public List<Block> getBlocks()
AbstractControlFlowGraph
getBlocks
in interface AbstractControlFlowGraph<Block>
CFGVerifier
public Block getStartBlock()
getStartBlock
in interface AbstractControlFlowGraph<Block>
public Iterable<Block> reversePostOrder()
public NodeMap<Block> getNodeToBlock()
public double frequencyFor(FixedNode node)
public List<Loop<Block>> getLoops()
getLoops
in interface AbstractControlFlowGraph<Block>
private void identifyBlock(Block block)
private void identifyBlocks()
private void connectBlocks()
private void computeLoopInformation()
private static void addBranchToLoop(Loop<Block> l, Block b)
private static void computeLoopBlocks(Block ablock, Loop<Block> aloop)
public void computePostdominators()
private static Block commonPostdominator(Block a, Block b)
public void setNodeToBlock(NodeMap<Block> nodeMap)