The code for which the CFG was build.
The unique exit node of the control flow graph if the method returns normally. If the method always throws an exception this node will not have any predecessors.
The unique exit node of the control flow graph if the method returns abnormally (throws an exception). If the method is guaranteed to never throw an exception, this node will not have any predecessors.
List of all catch nodes. (Usually, we have one CatchNode per org.opalj.br.ExceptionHandler, but if an exception handler does not catch anything, no CatchNode is created.)
An implicit map between a program counter and its associated BasicBlock; it may be a sparse array!
The unique exit node of the control flow graph if the method returns abnormally (throws an exception).
The unique exit node of the control flow graph if the method returns abnormally (throws an exception). If the method is guaranteed to never throw an exception, this node will not have any predecessors.
Iterates over the set of all BasicBlocks.
Iterates over the set of all BasicBlocks. (I.e., the exit and catch nodes are not returned.)
Returns the basic block to which the instruction with the given pc belongs.
Returns the basic block to which the instruction with the given pc belongs.
A valid pc.
The basic block associated with the given pc. If the pc is not valid
null is returned or an index out of bounds exception is thrown.
List of all catch nodes.
List of all catch nodes. (Usually, we have one CatchNode per org.opalj.br.ExceptionHandler, but if an exception handler does not catch anything, no CatchNode is created.)
The code for which the CFG was build.
Iterates over the direct successors of the instruction with the given pc and calls the given
function f for each successor.
Iterates over the direct successors of the instruction with the given pc and calls the given
function f for each successor. f is guaranteed to be called only once for each successor
instruction. (E.g., relevant in case of a switch where multiple cases are handled in the
same way.)
Creates a new CFG where the boundaries of the basic blocks are updated given the pcToIndex
mapping.
Creates a new CFG where the boundaries of the basic blocks are updated given the pcToIndex
mapping. The assumption is made that the indexes are continuous.
If the first index (i.e., pcToIndex(0) is not 0, then a new basic block for the indexes
in {0,pcToIndex(0)} is created if necessary.
The index of the last instruction of the underlying (non-empty) code array.
I.e., if the instruction array contains one instruction then the lastIndex has
to be 0.
The unique exit node of the control flow graph if the method returns normally.
The unique exit node of the control flow graph if the method returns normally. If the method always throws an exception this node will not have any predecessors.
Returns the set of all reachable CFGNodes of the control flow graph.
The basic block associated with the very first instruction.
Returns all direct runtime successors of the instruction with the given pc.
Returns all direct runtime successors of the instruction with the given pc.
If the returned set is empty, then the instruction is either a return instruction or an instruction that always causes an exception to be thrown that is not handled by a handler of the respective method.
A valid pc of an instruction of the code block from which this cfg was derived.
If possible the function foreachSuccessor should be used as it does not have
to create comparatively expensive intermediate data structures.
Represents the control flow graph of a method.
To compute a
CFGuse the CFGFactory.Thread-Safety
This class is thread-safe; all data is effectively immutable after construction time.
The code for which the CFG was build.
The unique exit node of the control flow graph if the method returns normally. If the method always throws an exception this node will not have any predecessors.
The unique exit node of the control flow graph if the method returns abnormally (throws an exception). If the method is guaranteed to never throw an exception, this node will not have any predecessors.
List of all catch nodes. (Usually, we have one CatchNode per org.opalj.br.ExceptionHandler, but if an exception handler does not catch anything, no CatchNode is created.)
An implicit map between a program counter and its associated BasicBlock; it may be a sparse array!