Package com.ibm.wala.cfg
Class InducedCFG.BasicBlock
- java.lang.Object
-
- com.ibm.wala.util.graph.impl.NodeWithNumber
-
- com.ibm.wala.cfg.InducedCFG.BasicBlock
-
- All Implemented Interfaces:
IBasicBlock<SSAInstruction>,INodeWithNumber,Iterable<SSAInstruction>
- Enclosing class:
- InducedCFG
public class InducedCFG.BasicBlock extends NodeWithNumber implements IBasicBlock<SSAInstruction>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPhi(SSAPhiInstruction phiInstruction)voidaddPi(SSAPiInstruction piInstruction)booleanendsInPEI()booleanendsInReturn()booleanequals(Object arg0)intgetFirstInstructionIndex()Get the index of the first instruction in the basic block.intgetLastInstructionIndex()Get the index of the last instruction in the basic block.IMethodgetMethod()intgetNumber()Each basic block should have a unique number in its cfgCollection<SSAPhiInstruction>getPhis()Collection<SSAPiInstruction>getPis()inthashCode()booleanisCatchBlock()Return true if the basic block represents a catch block.booleanisEntryBlock()Return true if the basic block represents the unique entry block.booleanisExitBlock()Return true if the basic block represents the unique exit block.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
-
getPhis
public Collection<SSAPhiInstruction> getPhis()
-
addPhi
public void addPhi(SSAPhiInstruction phiInstruction)
-
getPis
public Collection<SSAPiInstruction> getPis()
-
addPi
public void addPi(SSAPiInstruction piInstruction)
-
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<SSAInstruction>- 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<SSAInstruction>- Returns:
- the instruction index for the last instruction in the basic block
-
isCatchBlock
public boolean isCatchBlock()
Description copied from interface:IBasicBlockReturn true if the basic block represents a catch block.- Specified by:
isCatchBlockin interfaceIBasicBlock<SSAInstruction>- Returns:
- true if the basic block represents a catch block.
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
isExitBlock
public boolean isExitBlock()
Description copied from interface:IBasicBlockReturn true if the basic block represents the unique exit block.- Specified by:
isExitBlockin interfaceIBasicBlock<SSAInstruction>- Returns:
- true if the basic block represents the unique exit block.
-
isEntryBlock
public boolean isEntryBlock()
Description copied from interface:IBasicBlockReturn true if the basic block represents the unique entry block.- Specified by:
isEntryBlockin interfaceIBasicBlock<SSAInstruction>- Returns:
- true if the basic block represents the unique entry block.
-
getMethod
public IMethod getMethod()
- Specified by:
getMethodin interfaceIBasicBlock<SSAInstruction>- Returns:
- governing method for this block
-
endsInPEI
public boolean endsInPEI()
-
endsInReturn
public boolean endsInReturn()
-
getNumber
public int getNumber()
Description copied from interface:IBasicBlockEach basic block should have a unique number in its cfg- Specified by:
getNumberin interfaceIBasicBlock<SSAInstruction>- Returns:
- the basic block's number
-
iterator
public Iterator<SSAInstruction> iterator()
- Specified by:
iteratorin interfaceIterable<SSAInstruction>
-
-