|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.graph.AbstractGraph<Edge,BasicBlock>
edu.umd.cs.findbugs.ba.CFG
public class CFG
Simple control flow graph abstraction for BCEL.
BasicBlock
,
Edge
Nested Class Summary | |
---|---|
private class |
CFG.LocationIterator
An Iterator over the Locations in the CFG. |
Field Summary | |
---|---|
private BasicBlock |
entry
|
private BasicBlock |
exit
|
private int |
flags
|
Fields inherited from interface edu.umd.cs.findbugs.ba.Debug |
---|
CHECK_ASSERTIONS, VERIFY_INTEGRITY |
Constructor Summary | |
---|---|
CFG()
Constructor. |
Method Summary | |
---|---|
BasicBlock |
allocate()
Allocate a new BasicBlock. |
protected Edge |
allocateEdge(BasicBlock source,
BasicBlock target)
|
java.util.Iterator<BasicBlock> |
blockIterator()
Get an Iterator over the nodes (BasicBlocks) of the control flow graph. |
void |
checkIntegrity()
|
Edge |
createEdge(BasicBlock source,
BasicBlock dest,
int type)
Add a unique edge to the graph. |
java.util.Collection<BasicBlock> |
getBlocks(java.util.BitSet idSet)
Get Collection of basic blocks whose IDs are specified by given BitSet. |
java.util.Collection<BasicBlock> |
getBlocksContainingInstructionWithOffset(int offset)
Get a Collection of basic blocks which contain the bytecode instruction with given offset. |
BasicBlock |
getEntry()
Get the entry node. |
BasicBlock |
getExit()
Get the exit node. |
(package private) int |
getFlags()
|
int |
getMaxEdgeId()
Get the number of edge labels allocated. |
int |
getNumBasicBlocks()
Get number of basic blocks. |
Edge |
getOutgoingEdgeWithType(BasicBlock basicBlock,
int edgeType)
Get the first outgoing edge in basic block with given type. |
BasicBlock |
getSuccessorWithEdgeType(BasicBlock source,
int edgeType)
Get the first successor reachable from given edge type. |
(package private) boolean |
isFlagSet(int flag)
|
java.util.Iterator<Location> |
locationIterator()
Get an Iterator over the Locations in the control flow graph. |
Edge |
lookupEdgeById(int id)
Look up an Edge by its id. |
(package private) void |
setFlags(int flags)
|
Methods inherited from class edu.umd.cs.findbugs.graph.AbstractGraph |
---|
addVertex, containsVertex, createEdge, edgeIterator, getNumEdgeLabels, getNumEdges, getNumIncomingEdges, getNumOutgoingEdges, getNumVertexLabels, getNumVertices, incomingEdgeIterator, lookupEdge, outgoingEdgeIterator, predecessorIterator, removeEdge, removeVertex, setNumEdgeLabels, setNumVertexLabels, successorIterator, vertexIterator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private BasicBlock entry
private BasicBlock exit
private int flags
Constructor Detail |
---|
public CFG()
Method Detail |
---|
void setFlags(int flags)
int getFlags()
boolean isFlagSet(int flag)
public BasicBlock getEntry()
public BasicBlock getExit()
public Edge createEdge(BasicBlock source, BasicBlock dest, int type)
source
- the source basic blockdest
- the destination basic blocktype
- the type of edge; see constants in EdgeTypes interface
java.lang.IllegalStateException
- if there is already an edge in the CFG
with the same source and destination blockpublic Edge lookupEdgeById(int id)
id
- the id of the edge to look up
public java.util.Iterator<BasicBlock> blockIterator()
public java.util.Iterator<Location> locationIterator()
public java.util.Collection<BasicBlock> getBlocks(java.util.BitSet idSet)
idSet
- BitSet of block IDs
public java.util.Collection<BasicBlock> getBlocksContainingInstructionWithOffset(int offset)
offset
- the bytecode offset of an instruction
public BasicBlock getSuccessorWithEdgeType(BasicBlock source, int edgeType)
source
- the source blockedgeType
- the edge type leading to the successor
public Edge getOutgoingEdgeWithType(BasicBlock basicBlock, int edgeType)
basicBlock
- the basic blockedgeType
- the edge type
public BasicBlock allocate()
public int getNumBasicBlocks()
public int getMaxEdgeId()
public void checkIntegrity()
protected Edge allocateEdge(BasicBlock source, BasicBlock target)
allocateEdge
in class AbstractGraph<Edge,BasicBlock>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |