public class ControlFlowGraph extends Object implements IFlowgraph
Modifier and Type | Method and Description |
---|---|
Iterable<IBasicBlock> |
blocksInControlFlowOrder()
Get an iterator that will iterate over the blocks in the graph.
|
int |
findLineNumber(IBasicBlock b)
Find the closest matching line number to the start of a block.
|
int |
findLineNumber(IBasicBlock b,
int initialOffset)
Find the nearest debugline instruction preceeding the given
(Block,offset) position and fetch its line number.
|
String |
findSourcePath(IBasicBlock b)
Find the nearest debugfile instruction to the start of
the given block and fetch its source path.
|
String |
findSourcePath(IBasicBlock b,
int initialOffset)
Find the nearest instruction preceeding the given
(Block,offset) position and fetch its source path.
|
IBasicBlock |
getBlock(Label l)
Get a Label's target Block.
|
List<IBasicBlock> |
getBlocksInEntryOrder()
Get the graph's blocks in their original order.
|
DominatorTree |
getDominatorTree()
Touch the graph's dominator tree and fetch it.
|
IBasicBlock |
getStartBlock()
Get the start block.
|
boolean |
isCatchTarget(IBasicBlock b)
Is the given Block a catch target?
|
boolean |
isReachable(IBasicBlock b)
Is the given Block reachable?
|
void |
removeUnreachableBlock(IBasicBlock b)
Remove an unreachable block from the CFG.
|
void |
traverseGraph(IFlowGraphVisitor visitor)
Walk a IFlowGraphVisitor over this CFG.
|
public IBasicBlock getBlock(Label l)
getBlock
in interface IFlowgraph
l
- - the Label of interest.public IBasicBlock getStartBlock()
getStartBlock
in interface IFlowgraph
public boolean isCatchTarget(IBasicBlock b)
isCatchTarget
in interface IFlowgraph
b
- - the Block of interest.which differs from this routine in that it uses
positional information, which is not valid if the
ControlFlowGraph has been edited.
public Iterable<IBasicBlock> blocksInControlFlowOrder()
blocksInControlFlowOrder
in interface IFlowgraph
public List<IBasicBlock> getBlocksInEntryOrder()
getBlocksInEntryOrder
in interface IFlowgraph
public void traverseGraph(IFlowGraphVisitor visitor)
traverseGraph
in interface IFlowgraph
visitor
- - the visitor.public DominatorTree getDominatorTree()
getDominatorTree
in interface IFlowgraph
public void removeUnreachableBlock(IBasicBlock b)
removeUnreachableBlock
in interface IFlowgraph
b
- - the Block to remove.public boolean isReachable(IBasicBlock b)
isReachable
in interface IFlowgraph
b
- - the block of interest.public int findLineNumber(IBasicBlock b)
findLineNumber
in interface IFlowgraph
b
- the block of interest.public int findLineNumber(IBasicBlock b, int initialOffset)
findLineNumber
in interface IFlowgraph
b
- - the Block of interest.initialOffset
- - the start offset in the block.public String findSourcePath(IBasicBlock b)
findSourcePath
in interface IFlowgraph
b
- - the Block of interest.public String findSourcePath(IBasicBlock b, int initialOffset)
findSourcePath
in interface IFlowgraph
b
- - the Block of interest.initialOffset
- - the start offset in the block.Copyright © 2016 The Apache Software Foundation. All rights reserved.