Class AstTranslator.PreBasicBlock
java.lang.Object
com.ibm.wala.cast.ir.translator.AstTranslator.PreBasicBlock
- All Implemented Interfaces:
IBasicBlock<SSAInstruction>, INodeWithNumber, Iterable<SSAInstruction>
- Enclosing class:
AstTranslator
protected static final class AstTranslator.PreBasicBlock
extends Object
implements IBasicBlock<SSAInstruction>
basic block implementation used in the CFGs constructed during the IR-generating AST traversal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the index of the first instruction in the basic block.intA non-negative integer which serves as an identifier for this node in it's "dominant" graph.intGet the index of the last instruction in the basic block.intEach basic block should have a unique number in its cfgbooleanReturn true if the basic block represents a catch block.booleanReturn true if the basic block represents the unique entry block.booleanReturn true if the basic block represents the unique exit block.booleaniterator()voidsetGraphNodeId(int number) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
PreBasicBlock
protected PreBasicBlock()
-
-
Method Details
-
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
-
getGraphNodeId
public int getGraphNodeId()Description copied from interface:INodeWithNumberA non-negative integer which serves as an identifier for this node in it's "dominant" graph. Initially this number is -1; a NumberedGraph will set it to a non-negative value when this node is inserted into the graph- Specified by:
getGraphNodeIdin interfaceINodeWithNumber- Returns:
- the identifier
-
setGraphNodeId
public void setGraphNodeId(int number) - Specified by:
setGraphNodeIdin interfaceINodeWithNumber
-
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
-
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.
-
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.
-
isHandlerBlock
public boolean isHandlerBlock() -
toString
-
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.
-
getMethod
- Specified by:
getMethodin interfaceIBasicBlock<SSAInstruction>- Returns:
- governing method for this block
-
iterator
- Specified by:
iteratorin interfaceIterable<SSAInstruction>
-