ControlFlowGraph: graph of basic blocks connected by control edges.
More...
#include "cfg.h"
ControlFlowGraph: graph of basic blocks connected by control edges.
There are dedicated empty entry and exit blocks. An InstructionSequence can be converted to a ControlFlowGraph by a ControlFlowGraphBuilder object.
◆ adopt_basic_block()
◆ bb_begin()
| BlockList::const_iterator ControlFlowGraph::bb_begin |
( |
| ) |
const |
|
inline |
Get a begin iterator for the list of all basic blocks in the ControlFlowGraph.
- Returns
- begin iterator to list of basic blocks
◆ bb_end()
| BlockList::const_iterator ControlFlowGraph::bb_end |
( |
| ) |
const |
|
inline |
Get an end iterator for the list of all basic blocks in the ControlFlowGraph.
- Returns
- end iterator to list of basic blocks
◆ create_basic_block()
Create a new InstructionSequence.
Use BASICBLOCK_INTERIOR for all blocks except for entry and exit. The label parameter should be a non-empty string if the InstructionSequence is reached via one or more branch instructions (which should have this label as their Operand.)
- Parameters
-
| kind | the BasicBlockKind for the block to be created |
| code_order | relative order of this basic block in the original InstructionSequence (so that when the ControlFlowGraph is converted back to an InstructionSequence, the instructions are in the "correct" order) |
| label | label of the first instruction (if this basic block is reached by any branch edges) |
- Returns
- a shared pointer to the new basic block
◆ create_edge()
Create Edge of given kind from source basic block to target basic block.
Note that Edge objects are owned by the ControlFlowGraph.
- Parameters
-
| source | the source basic block |
| target | the target basic block |
| the | EdgeKind of the Edge to create |
- Returns
- the created Edge
◆ create_instruction_sequence()
◆ get_block()
Get block with specified id.
- Parameters
-
| id | the id value of a basic block |
- Returns
- the basic block with the specified id
◆ get_entry_block()
Get pointer to the dedicated empty entry block.
- Returns
- the entry block
◆ get_exit_block()
Get pointer to the dedicated empty exit block.
- Returns
- the exit block
◆ get_incoming_edges()
Get vector of all incoming edges to given block.
- Parameters
-
- Returns
- EdgeList of all incoming edges to the basic block
◆ get_num_blocks()
| unsigned ControlFlowGraph::get_num_blocks |
( |
| ) |
const |
|
inline |
Get total number of basic blocks (including entry and exit).
- Returns
- total number of basic blocks
◆ get_outgoing_edges()
Get vector of all outgoing edges from given block.
- Parameters
-
- Returns
- EdgeList of all outgoing edges from the basic block
◆ lookup_edge()
Look up edge from specified source block to target block.
Returns a null pointer if no such block exists
- Parameters
-
| source | the source basic block |
| target | the target basic block |
- Returns
- the Edge connecting the source block to the target block, or a null pointer if there is no such control edge
The documentation for this class was generated from the following files: