Package com.ibm.wala.ipa.cfg
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
Constructors Constructor Description BasicBlockInContext(CGNode node, T bb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Iterator<TypeReference>
getCaughtExceptionTypes()
T
getDelegate()
int
getFirstInstructionIndex()
Get the index of the first instruction in the basic block.SSAInstruction
getLastInstruction()
int
getLastInstructionIndex()
Get the index of the last instruction in the basic block.IMethod
getMethod()
CGNode
getNode()
int
getNumber()
Each basic block should have a unique number in its cfgint
hashCode()
boolean
isCatchBlock()
Is this block a catch blockboolean
isEntryBlock()
Does this block represent the unique entry to aControlFlowGraph
boolean
isExitBlock()
Does this block represent the unique exit from aControlFlowGraph
?Iterator<SSAPhiInstruction>
iteratePhis()
Iterator<SSAPiInstruction>
iteratePis()
Iterator<SSAInstruction>
iterator()
String
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
-
-
-
-
Method Detail
-
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.
-
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
-
iterator
public Iterator<SSAInstruction> iterator()
- Specified by:
iterator
in interfaceIterable<T extends ISSABasicBlock>
-
getMethod
public IMethod getMethod()
- Specified by:
getMethod
in interfaceIBasicBlock<T extends ISSABasicBlock>
- Returns:
- governing method for this block
-
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
-
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.
-
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.
-
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.
-
getDelegate
public T getDelegate()
-
getNode
public CGNode getNode()
-
getCaughtExceptionTypes
public Iterator<TypeReference> getCaughtExceptionTypes()
- Specified by:
getCaughtExceptionTypes
in interfaceISSABasicBlock
- Returns:
- the set of exception types this block may catch.
-
getLastInstruction
public SSAInstruction getLastInstruction()
- Specified by:
getLastInstruction
in interfaceISSABasicBlock
- Returns:
- the last instruction in this block.
-
iteratePhis
public Iterator<SSAPhiInstruction> iteratePhis()
- Specified by:
iteratePhis
in interfaceISSABasicBlock
- Returns:
- the phi instructions incoming to this block
-
iteratePis
public Iterator<SSAPiInstruction> iteratePis()
- Specified by:
iteratePis
in interfaceISSABasicBlock
- Returns:
- the pi instructions incoming to this block
-
-