sail::Cfg Class Reference

Representation of a control flow graph. More...

#include <Cfg.h>

List of all members.

Public Member Functions

 Cfg (Function *f, bool exit_fn_modifies_control=false)
string to_dotty (bool pretty_print=true)
set< Block * > & get_blocks ()
set< BasicBlock * > & get_basic_blocks ()
BasicBlockget_entry_block ()
BasicBlockget_exit_block ()
BasicBlockget_exception_block ()
SuperBlockget_superblock (const Identifier &id)
const vector< SuperBlock * > & get_ordered_superblocks ()
bool is_header_of_superblock (BasicBlock *b)
SuperBlockget_superblock_of_entry_block (BasicBlock *b)

Friends

class boost::serialization::access

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)
BasicBlock * sail::Cfg::get_entry_block (  ) 
Returns:
Entry block of the CFG.
BasicBlock * sail::Cfg::get_exception_block (  ) 
Returns:
Exception block of the CFG.
BasicBlock * sail::Cfg::get_exit_block (  ) 
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.

SuperBlock * sail::Cfg::get_superblock ( const Identifier id  ) 
Parameters:
id of a SuperBlock
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:
Generated on Sun Oct 17 14:01:32 2010 by  doxygen 1.6.3