sail::Cfg Class Reference
Representation of a control flow graph.
More...
#include <Cfg.h>
List of all members.
Detailed Description
Representation of a control flow graph.
Each CFG maintains the invariants of having a single entry and single exit block. In addition, there is an additional exception block that is target of any exit function (function that aborts execution) or exception.
Constructor & Destructor Documentation
sail::Cfg::Cfg |
( |
Function * |
f, |
|
|
bool |
exit_fn_modifies_control = false | |
|
) |
| | |
- Parameters:
-
| f | The function to generate the CFG from. |
| exit_fn_modifies_control | If this is set to true, functions that abort execution modify control flow. e.g., if there is a call to exit(), then the successor of this basic block is the exception block. |
Member Function Documentation
set< BasicBlock * > & sail::Cfg::get_basic_blocks |
( |
|
) |
|
- Returns:
- set of basic blocks in the CFG.
set< Block * > & sail::Cfg::get_blocks |
( |
|
) |
|
- Returns:
- all blocks in the cfg (both basic and superblocks)
- Returns:
- Entry block of the CFG.
- Returns:
- Exception block of the CFG.
- Returns:
- Exit block of the CFG.
const vector< SuperBlock * > & sail::Cfg::get_ordered_superblocks |
( |
|
) |
|
If loop X is nested inside loop Y, X appears before Y in the returned vector.
- Parameters:
-
- Returns:
- SuperBlock with this id, NULL if it does not exist.
string sail::Cfg::to_dotty |
( |
bool |
pretty_print = true |
) |
|
For drawing a dotty representation of the CFG.
- Parameters:
-
| pretty_print | If pretty_print is false, then the low level instructions are printed, otherwise the higher level representation is used. |
- Returns:
- a string that can be fed to the dot program.
The documentation for this class was generated from the following files: