Class BasicBlockInContext<T extends ISSABasicBlock>
java.lang.Object
com.ibm.wala.util.graph.impl.NodeWithNumber
com.ibm.wala.ipa.cfg.BasicBlockInContext<T>
- All Implemented Interfaces:
IBasicBlock<SSAInstruction>
,ISSABasicBlock
,INodeWithNumber
,Iterable<SSAInstruction>
public final class BasicBlockInContext<T extends ISSABasicBlock>
extends NodeWithNumber
implements ISSABasicBlock
A helper class to make the ipcfg work correctly with context-sensitive call graphs.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Get the index of the first instruction in the basic block.int
Get the index of the last instruction in the basic block.getNode()
int
Each basic block should have a unique number in its cfgint
hashCode()
boolean
Is this block a catch blockboolean
Does this block represent the unique entry to aControlFlowGraph
boolean
Does this block represent the unique exit from aControlFlowGraph
?iterator()
toString()
Methods inherited from class com.ibm.wala.util.graph.impl.NodeWithNumber
getGraphNodeId, setGraphNodeId
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.ibm.wala.util.graph.INodeWithNumber
getGraphNodeId, setGraphNodeId
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BasicBlockInContext
-
-
Method Details
-
getFirstInstructionIndex
public int getFirstInstructionIndex()Description copied from interface:IBasicBlock
Get the index of the first instruction in the basic block. The value is an index into the instruction array that contains all the instructions for the method.If the result is < 0, the block has no instructions
- Specified by:
getFirstInstructionIndex
in interfaceIBasicBlock<T extends ISSABasicBlock>
- Returns:
- the instruction index for the first instruction in the basic block.
- See Also:
-
getLastInstructionIndex
public int getLastInstructionIndex()Description copied from interface:IBasicBlock
Get the index of the last instruction in the basic block. The value is an index into the instruction array that contains all the instructions for the method.If the result is < 0, the block has no instructions
- Specified by:
getLastInstructionIndex
in interfaceIBasicBlock<T extends ISSABasicBlock>
- Returns:
- the instruction index for the last instruction in the basic block
- See Also:
-
iterator
- Specified by:
iterator
in interfaceIterable<T extends ISSABasicBlock>
- See Also:
-
getMethod
- Specified by:
getMethod
in interfaceIBasicBlock<T extends ISSABasicBlock>
- Returns:
- governing method for this block
- See Also:
-
getNumber
public int getNumber()Description copied from interface:IBasicBlock
Each basic block should have a unique number in its cfg- Specified by:
getNumber
in interfaceIBasicBlock<T extends ISSABasicBlock>
- Returns:
- the basic block's number
- See Also:
-
isCatchBlock
public boolean isCatchBlock()Description copied from interface:ISSABasicBlock
Is this block a catch block- Specified by:
isCatchBlock
in interfaceIBasicBlock<T extends ISSABasicBlock>
- Specified by:
isCatchBlock
in interfaceISSABasicBlock
- Returns:
- true if the basic block represents a catch block.
- See Also:
-
isEntryBlock
public boolean isEntryBlock()Description copied from interface:ISSABasicBlock
Does this block represent the unique entry to aControlFlowGraph
- Specified by:
isEntryBlock
in interfaceIBasicBlock<T extends ISSABasicBlock>
- Specified by:
isEntryBlock
in interfaceISSABasicBlock
- Returns:
- true if the basic block represents the unique entry block.
- See Also:
-
isExitBlock
public boolean isExitBlock()Description copied from interface:ISSABasicBlock
Does this block represent the unique exit from aControlFlowGraph
?- Specified by:
isExitBlock
in interfaceIBasicBlock<T extends ISSABasicBlock>
- Specified by:
isExitBlock
in interfaceISSABasicBlock
- Returns:
- true if the basic block represents the unique exit block.
- See Also:
-
hashCode
-
equals
-
getDelegate
-
getNode
-
toString
-
getCaughtExceptionTypes
- Specified by:
getCaughtExceptionTypes
in interfaceISSABasicBlock
- Returns:
- the set of exception types this block may catch.
-
getLastInstruction
- Specified by:
getLastInstruction
in interfaceISSABasicBlock
- Returns:
- the last instruction in this block.
-
iteratePhis
- Specified by:
iteratePhis
in interfaceISSABasicBlock
- Returns:
- the phi instructions incoming to this block
-
iteratePis
- Specified by:
iteratePis
in interfaceISSABasicBlock
- Returns:
- the pi instructions incoming to this block
-