Interface IBasicBlock<InsnType extends IInstruction>
- Type Parameters:
InsnType
-
- All Superinterfaces:
Iterable<InsnType>
- All Known Implementing Classes:
BasicBlock
,BasicBlock
Generic interface for CFG's basic block objects.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the total number of input edges to this block.int
boolean
canThrow()
get
(int index) Get the instruction at the specified index.long
getAddressOfInstruction
(int index) List<? extends IBasicBlock<InsnType>>
Iterable<? extends IBasicBlock<InsnType>>
Retrieve a read-only iterable of regular and irregular input blocks.List<? extends IBasicBlock<InsnType>>
Get regular and irregular output blocks.Iterable<? extends IBasicBlock<InsnType>>
Retrieve a read-only iterable of regular and irregular output blocks.long
getBase()
Address of first instruction in the block.long
Address following the last instruction of the block (ie, last exclusive address).long
Address of first instruction in the block.int
getIndexOfInstruction
(long address) getInputBlock
(int index) Get a regular input block.List<? extends IBasicBlock<InsnType>>
Get the regular input blocks.List<? extends IBasicBlock<InsnType>>
Retrieve a read-only list of input blocks (regular).getInstruction
(long address) Get the instruction located at the exact address.Get a copy of the list of instructions that make up this basic block.getIrregularInputBlock
(int index) Get an irregular input block.List<? extends IBasicBlock<InsnType>>
List<? extends IBasicBlock<InsnType>>
Retrieve a read-only list of irregular input blocks.getIrregularOutputBlock
(int index) Get an irregular output block.List<? extends IBasicBlock<InsnType>>
Get irregular output blocks.List<? extends IBasicBlock<InsnType>>
Retrieve a read-only list of irregular output blocks.getLast()
Get the last instruction of the block.long
Address of last instruction in the block.getOutputBlock
(int index) Get a regular output block.List<? extends IBasicBlock<InsnType>>
Get the regular output blocks.List<? extends IBasicBlock<InsnType>>
Retrieve a read-only list of output blocks (regular).int
int
insize()
Get the number of regular input edges to this block.int
Get the number of irregular input edges to this block.int
boolean
isEmpty()
Determine if the block has 0 instruction.int
outsize()
int
size()
Get the number of instructions in the block.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getFirstAddress
long getFirstAddress()Address of first instruction in the block.- Returns:
-
getBase
long getBase()Address of first instruction in the block.- Returns:
-
getLastAddress
long getLastAddress()Address of last instruction in the block.- Returns:
-
getEndAddress
long getEndAddress()Address following the last instruction of the block (ie, last exclusive address).- Returns:
-
isEmpty
boolean isEmpty()Determine if the block has 0 instruction.- Returns:
-
size
int size()Get the number of instructions in the block.- Returns:
-
get
Get the instruction at the specified index.- Parameters:
index
-- Returns:
-
getLast
InsnType getLast()Get the last instruction of the block.- Returns:
-
getInstructions
Get a copy of the list of instructions that make up this basic block.- Returns:
-
getSizeOfInstructions
int getSizeOfInstructions() -
getAddressOfInstruction
long getAddressOfInstruction(int index) -
getIndexOfInstruction
int getIndexOfInstruction(long address) - Parameters:
address
- instruction address- Returns:
- -1 if there is no instruction starting at the provided address
-
getInstruction
Get the instruction located at the exact address.- Parameters:
address
-- Returns:
-
canThrow
boolean canThrow() -
getOutputBlocks
List<? extends IBasicBlock<InsnType>> getOutputBlocks()Get the regular output blocks.- Returns:
- a copy of the list of regular output blocks
-
getOutputBlock
Get a regular output block.- Parameters:
index
-- Returns:
-
getIrregularOutputBlocks
List<? extends IBasicBlock<InsnType>> getIrregularOutputBlocks()Get irregular output blocks.- Returns:
- a copy of the list of irregular output blocks
-
getIrregularOutputBlock
Get an irregular output block.- Parameters:
index
-- Returns:
-
getAllOutputBlocks
List<? extends IBasicBlock<InsnType>> getAllOutputBlocks()Get regular and irregular output blocks.- Returns:
- a copy of the list of all output blocks
-
getOutputs
List<? extends IBasicBlock<InsnType>> getOutputs()Retrieve a read-only list of output blocks (regular).NOTE: This method is faster than
getOutputBlocks()
since it does not provide a copy of the list.- Returns:
-
getIrregularOutputs
List<? extends IBasicBlock<InsnType>> getIrregularOutputs()Retrieve a read-only list of irregular output blocks.NOTE: This method is faster than
getIrregularOutputBlocks()
since it does not provide a copy of the list.- Returns:
-
getAllOutputs
Iterable<? extends IBasicBlock<InsnType>> getAllOutputs()Retrieve a read-only iterable of regular and irregular output blocks.NOTE: This method is faster than
getAllOutputBlocks()
since it does not provide a copy of the list.- Returns:
-
getInputBlocks
List<? extends IBasicBlock<InsnType>> getInputBlocks()Get the regular input blocks.- Returns:
- a copy of the list of regular input blocks
-
getInputBlock
Get a regular input block.- Parameters:
index
- block index- Returns:
- a block
-
getIrregularInputBlocks
List<? extends IBasicBlock<InsnType>> getIrregularInputBlocks() -
getIrregularInputBlock
Get an irregular input block.- Parameters:
index
- block index- Returns:
- a block
-
getAllInputBlocks
List<? extends IBasicBlock<InsnType>> getAllInputBlocks() -
getInputs
List<? extends IBasicBlock<InsnType>> getInputs()Retrieve a read-only list of input blocks (regular).NOTE: This method is faster than
getInputBlocks()
since it does not provide a copy of the list.- Returns:
-
getIrregularInputs
List<? extends IBasicBlock<InsnType>> getIrregularInputs()Retrieve a read-only list of irregular input blocks.NOTE: This method is faster than
getIrregularInputBlocks()
since it does not provide a copy of the list.- Returns:
-
getAllInputs
Iterable<? extends IBasicBlock<InsnType>> getAllInputs()Retrieve a read-only iterable of regular and irregular input blocks.NOTE: This method is faster than
getAllInputBlocks()
since it does not provide a copy of the list.- Returns:
-
outsize
int outsize() -
irroutsize
int irroutsize() -
alloutsize
int alloutsize() -
insize
int insize()Get the number of regular input edges to this block.- Returns:
-
irrinsize
int irrinsize()Get the number of irregular input edges to this block.- Returns:
-
allinsize
int allinsize()Get the total number of input edges to this block.- Returns:
-