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 booleanequals(Object obj)Iterator<TypeReference>getCaughtExceptionTypes()TgetDelegate()intgetFirstInstructionIndex()Get the index of the first instruction in the basic block.SSAInstructiongetLastInstruction()intgetLastInstructionIndex()Get the index of the last instruction in the basic block.IMethodgetMethod()CGNodegetNode()intgetNumber()Each basic block should have a unique number in its cfginthashCode()booleanisCatchBlock()Is this block a catch blockbooleanisEntryBlock()Does this block represent the unique entry to aControlFlowGraphbooleanisExitBlock()Does this block represent the unique exit from aControlFlowGraph?Iterator<SSAPhiInstruction>iteratePhis()Iterator<SSAPiInstruction>iteratePis()Iterator<SSAInstruction>iterator()StringtoString()-
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:IBasicBlockGet 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:
getFirstInstructionIndexin interfaceIBasicBlock<T extends ISSABasicBlock>- Returns:
- the instruction index for the first instruction in the basic block.
-
getLastInstructionIndex
public int getLastInstructionIndex()
Description copied from interface:IBasicBlockGet 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:
getLastInstructionIndexin interfaceIBasicBlock<T extends ISSABasicBlock>- Returns:
- the instruction index for the last instruction in the basic block
-
iterator
public Iterator<SSAInstruction> iterator()
- Specified by:
iteratorin interfaceIterable<T extends ISSABasicBlock>
-
getMethod
public IMethod getMethod()
- Specified by:
getMethodin interfaceIBasicBlock<T extends ISSABasicBlock>- Returns:
- governing method for this block
-
getNumber
public int getNumber()
Description copied from interface:IBasicBlockEach basic block should have a unique number in its cfg- Specified by:
getNumberin interfaceIBasicBlock<T extends ISSABasicBlock>- Returns:
- the basic block's number
-
isCatchBlock
public boolean isCatchBlock()
Description copied from interface:ISSABasicBlockIs this block a catch block- Specified by:
isCatchBlockin interfaceIBasicBlock<T extends ISSABasicBlock>- Specified by:
isCatchBlockin interfaceISSABasicBlock- Returns:
- true if the basic block represents a catch block.
-
isEntryBlock
public boolean isEntryBlock()
Description copied from interface:ISSABasicBlockDoes this block represent the unique entry to aControlFlowGraph- Specified by:
isEntryBlockin interfaceIBasicBlock<T extends ISSABasicBlock>- Specified by:
isEntryBlockin interfaceISSABasicBlock- Returns:
- true if the basic block represents the unique entry block.
-
isExitBlock
public boolean isExitBlock()
Description copied from interface:ISSABasicBlockDoes this block represent the unique exit from aControlFlowGraph?- Specified by:
isExitBlockin interfaceIBasicBlock<T extends ISSABasicBlock>- Specified by:
isExitBlockin 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:
getCaughtExceptionTypesin interfaceISSABasicBlock- Returns:
- the set of exception types this block may catch.
-
getLastInstruction
public SSAInstruction getLastInstruction()
- Specified by:
getLastInstructionin interfaceISSABasicBlock- Returns:
- the last instruction in this block.
-
iteratePhis
public Iterator<SSAPhiInstruction> iteratePhis()
- Specified by:
iteratePhisin interfaceISSABasicBlock- Returns:
- the phi instructions incoming to this block
-
iteratePis
public Iterator<SSAPiInstruction> iteratePis()
- Specified by:
iteratePisin interfaceISSABasicBlock- Returns:
- the pi instructions incoming to this block
-
-