Class ControlFlowGraph#

Inheritance Relationships#

Base Type#

Class Documentation#

class ControlFlowGraph : public SimpleDirectedGraph#

This class constructs a control flow graph for a given function definition. It builds off of information provided by CFGImpl.h, and adds some additional bookkeeping information (such as entry and exit points, as well as having a separate node for each statement in the graph).

This class extends SimpleDirectedGraph templated on ControlNode

Public Types

enum ID_dir#

determines the ordering of id numbers

Certain uses of the CFG rely on a specific numbering scheme for the nodes of the CFG. The nodes can either be numbered in breadth-first-search order rooted at the entry node, and following edges forward, or in breadth-first-search order rooted at the exit node and following edges backward.

Values:

enumerator FORWARD#
enumerator BACKWARD#

Public Functions

ControlFlowGraph(SgNode *head)#

The constructor for ControlFlowGraph. Builds a CFG rooted at head.

void createNode(CFGNodeImpl *node)#

from a given CFGImpl node, create one (or more) ControlNodes

inline int getSize()#

return the number of nodes in the CFG

inline ControlNode *getNode(int id, ID_dir dir)#

given a node id (and which numbering scheme to use), return the appropriate control node

void outputCFGImpl()#

dump the contents of the original CFGImpl to a dot file