Class CFG

Contents

Class CFG#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Class Documentation#

class CFG : public DGraph#

CFG is a DGraph (directed graph) with enhanced nodes and edges.

Each node in the CFG points to a list of statements that together represent a basic block. The entire program would be represented by a set of CFGs, one for each subroutine, and one for the main program.

Public Types

enum EdgeType#

Values:

enumerator TRUE_EDGE#
enumerator FALLTHROUGH_EDGE#
enumerator FALSE_EDGE#
enumerator BACK_EDGE#
enumerator MULTIWAY_EDGE#
enumerator BREAK_EDGE#
enumerator CONTINUE_EDGE#
enumerator RETURN_EDGE#
typedef std::list<Node*> NodeList#

Public Functions

CFG(IRInterface &_ir, IRStmtIterator *si, SymHandle name, bool return_statements_allowed = true)#
virtual ~CFG()#
inline Node *Entry()#
inline Node *Exit()#
inline IRInterface &GetIRInterface()#
void dump(std::ostream &os)#
inline void dump()#
inline SymHandle subprog_name()#
void compute_uses_sets()#
void compute_defs_sets()#
Node *splitBlock(Node*, StmtHandle)#
inline void connect(Node *src, Node *dst, EdgeType type)#
inline void connect(Node *src, Node *dst, EdgeType type, ExprHandle expr)#
void connect(Node*, NodeLabelList&)#
void connect(NodeLabelList&, Node*)#
inline void disconnect(Edge *e)#
CFG::Node *node_from_label(StmtLabel)#

Friends

friend class Node
friend class NonLocalsIterator
friend class DefBlocksIterator
class DefBlocksIterator : public Iterator#

Public Functions

inline DefBlocksIterator(CFG &cfg, SymHandle name)#
inline virtual void operator++()#
inline virtual operator bool()#
inline operator Node*()#
class DFSIterator : public DGraph::DFSIterator#

Public Functions

inline DFSIterator(CFG &g)#
inline virtual ~DFSIterator()#
inline operator Node*()#
inline virtual operator bool()#
class Edge : public DGraph::Edge#

Public Functions

Edge(Node *n1, Node *n2, EdgeType type, ExprHandle expr)#
inline virtual ~Edge()#
inline EdgeType getType()#
virtual void dump(std::ostream &os)#
inline void dump()#
class Node : public DGraph::Node#

Public Functions

inline Node()#
inline Node(StmtHandle n)#
inline virtual ~Node()#
inline unsigned int getID()#
inline void add(StmtHandle h)#
StmtHandle erase(StmtHandle h)#
inline unsigned int size()#
inline bool empty()#
inline void addEndExpr(ExprHandle expr)#
inline ExprHandle getEndExpr()#
void split(StmtHandle splitPoint, Node *newBlock)#
inline virtual void dump(std::ostream &os)#
void longdump(CFG*, std::ostream &os)#
inline void longdump(CFG *_cfg)#

Friends

friend class CFG
friend class CFG::NodeStatementsIterator
class NodeListIterator : public Iterator#

Public Functions

inline NodeListIterator(NodeList *nl)#
inline virtual ~NodeListIterator()#
inline virtual void operator++()#
inline virtual operator bool()#
inline operator Node*()#
class NodeStatementsIterator : public Iterator#

Public Functions

inline NodeStatementsIterator(Node *node)#
inline ~NodeStatementsIterator()#
inline virtual void operator++()#
inline virtual operator bool()#
inline operator StmtHandle()#
class NonLocalsIterator : public Iterator#

Public Functions

inline NonLocalsIterator(CFG &c)#
inline virtual void operator++()#
inline virtual operator bool()#
inline operator LeafHandle()#
class Unexpected_Break : public Exception#

Public Functions

inline void report(std::ostream &os) const#
class Unexpected_Continue : public Exception#

Public Functions

inline void report(std::ostream &os) const#
class Unexpected_Return : public Exception#

Public Functions

inline void report(std::ostream &os) const#