ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StaticCFG::CFG Class Reference

#include <staticCFG.h>

Inheritance diagram for StaticCFG::CFG:
Collaboration diagram for StaticCFG::CFG:

Public Member Functions

 CFG ()
 
CFGNode toCFGNode (SgGraphNode *node)
 Turn a graph node into a CFGNode which is defined in VirtualCFG namespace. More...
 
SgGraphNodetoGraphNode (CFGNode &n)
 Turn a CFG node into a GraphNode which is defined in VirtualCFG namespace. More...
 
 CFG (SgNode *node, bool is_filtered=false)
 The constructor building the CFG. More...
 
SgIncidenceDirectedGraphgetGraph () const
 Get the pointer pointing to the graph used by static CFG. More...
 
virtual ~CFG ()
 
void setStart (SgNode *node)
 Set the start node for graph building. More...
 
SgGraphNodegetEntry () const
 Get the entry node of the CFG. More...
 
SgGraphNodegetExit () const
 Get the exit node of the CFG. More...
 
bool isFilteredCFG () const
 
void setFiltered (bool flag)
 
virtual void buildCFG ()
 Build CFG according to the 'is_filtered_' flag. More...
 
virtual void buildFullCFG ()
 Build CFG for debugging. More...
 
virtual void buildFilteredCFG ()
 Build filtered CFG which only contains interesting nodes. More...
 
std::vector
< SgDirectedGraphEdge * > 
getOutEdges (SgGraphNode *node)
 
std::vector
< SgDirectedGraphEdge * > 
getInEdges (SgGraphNode *node)
 
SgGraphNodecfgForBeginning (SgNode *node)
 
SgGraphNodecfgForEnd (SgNode *node)
 
void cfgToDot (SgNode *node, const std::string &file_name)
 Output the graph to a DOT file. More...
 

Static Public Member Functions

static int getIndex (SgGraphNode *node)
 Get the index of a CFG node. More...
 

Protected Member Functions

template<class NodeT , class EdgeT >
void buildCFG (NodeT n, std::map< NodeT, SgGraphNode * > &all_nodes, std::set< NodeT > &explored)
 
void clearNodesAndEdges ()
 Delete all nodes and edges in the graph and release memories. More...
 
virtual void processNodes (std::ostream &o, SgGraphNode *n, std::set< SgGraphNode * > &explored)
 
virtual void printNodePlusEdges (std::ostream &o, SgGraphNode *node)
 
virtual void printNode (std::ostream &o, SgGraphNode *node)
 
virtual void printEdge (std::ostream &o, SgDirectedGraphEdge *edge, bool isInEdge)
 

Protected Attributes

SgIncidenceDirectedGraphgraph_
 The graph data structure holding the CFG. More...
 
std::map< CFGNode, SgGraphNode * > all_nodes_
 A map from CFGNode in virtualCFG to node from staticCFG. More...
 
SgNodestart_
 The start node to begin CFG build. More...
 
SgGraphNodeentry_
 The entry node. More...
 
SgGraphNodeexit_
 The exit node. More...
 
bool is_filtered_
 A flag shows whether this CFG is filtered or not. More...
 

Detailed Description

Definition at line 24 of file staticCFG.h.

Constructor & Destructor Documentation

StaticCFG::CFG::CFG ( )
inline

Definition at line 46 of file staticCFG.h.

StaticCFG::CFG::CFG ( SgNode node,
bool  is_filtered = false 
)
inline

The constructor building the CFG.

The valid nodes are SgProject, SgStatement, SgExpression and SgInitializedName.

Definition at line 57 of file staticCFG.h.

virtual StaticCFG::CFG::~CFG ( )
inlinevirtual

Definition at line 65 of file staticCFG.h.

Member Function Documentation

CFGNode StaticCFG::CFG::toCFGNode ( SgGraphNode node)

Turn a graph node into a CFGNode which is defined in VirtualCFG namespace.

Referenced by visitorTraversal::analyzePath(), evalFunction(), getGraphNodeType(), and instantiateGraph().

SgGraphNode* StaticCFG::CFG::toGraphNode ( CFGNode n)
inline

Turn a CFG node into a GraphNode which is defined in VirtualCFG namespace.

Returns NULL if CFGNode is not present

Definition at line 53 of file staticCFG.h.

Referenced by instantiateGraph().

SgIncidenceDirectedGraph* StaticCFG::CFG::getGraph ( ) const
inline

Get the pointer pointing to the graph used by static CFG.

Definition at line 62 of file staticCFG.h.

Referenced by yicesCheck().

void StaticCFG::CFG::setStart ( SgNode node)
inline

Set the start node for graph building.

The valid nodes are SgProject, SgStatement, SgExpression and SgInitializedName.

Definition at line 70 of file staticCFG.h.

SgGraphNode* StaticCFG::CFG::getEntry ( ) const
inline

Get the entry node of the CFG.

Definition at line 73 of file staticCFG.h.

Referenced by instantiateGraph().

SgGraphNode* StaticCFG::CFG::getExit ( ) const
inline

Get the exit node of the CFG.

Definition at line 77 of file staticCFG.h.

bool StaticCFG::CFG::isFilteredCFG ( ) const
inline

Definition at line 80 of file staticCFG.h.

void StaticCFG::CFG::setFiltered ( bool  flag)
inline

Definition at line 81 of file staticCFG.h.

virtual void StaticCFG::CFG::buildCFG ( )
inlinevirtual

Build CFG according to the 'is_filtered_' flag.

Reimplemented in StaticCFG::InterproceduralCFG.

Definition at line 85 of file staticCFG.h.

virtual void StaticCFG::CFG::buildFullCFG ( )
virtual

Build CFG for debugging.

Reimplemented in StaticCFG::InterproceduralCFG.

virtual void StaticCFG::CFG::buildFilteredCFG ( )
virtual

Build filtered CFG which only contains interesting nodes.

Reimplemented in StaticCFG::InterproceduralCFG, StaticCFG::CustomFilteredCFG< _Filter >, and StaticCFG::CustomFilteredCFG< AliasCfgFilter >.

std::vector<SgDirectedGraphEdge*> StaticCFG::CFG::getOutEdges ( SgGraphNode node)
std::vector<SgDirectedGraphEdge*> StaticCFG::CFG::getInEdges ( SgGraphNode node)
SgGraphNode* StaticCFG::CFG::cfgForBeginning ( SgNode node)
SgGraphNode* StaticCFG::CFG::cfgForEnd ( SgNode node)
static int StaticCFG::CFG::getIndex ( SgGraphNode node)
static

Get the index of a CFG node.

void StaticCFG::CFG::cfgToDot ( SgNode node,
const std::string &  file_name 
)

Output the graph to a DOT file.

template<class NodeT , class EdgeT >
void StaticCFG::CFG::buildCFG ( NodeT  n,
std::map< NodeT, SgGraphNode * > &  all_nodes,
std::set< NodeT > &  explored 
)
protected
void StaticCFG::CFG::clearNodesAndEdges ( )
protected

Delete all nodes and edges in the graph and release memories.

virtual void StaticCFG::CFG::processNodes ( std::ostream &  o,
SgGraphNode n,
std::set< SgGraphNode * > &  explored 
)
protectedvirtual
virtual void StaticCFG::CFG::printNodePlusEdges ( std::ostream &  o,
SgGraphNode node 
)
protectedvirtual
virtual void StaticCFG::CFG::printNode ( std::ostream &  o,
SgGraphNode node 
)
protectedvirtual
virtual void StaticCFG::CFG::printEdge ( std::ostream &  o,
SgDirectedGraphEdge edge,
bool  isInEdge 
)
protectedvirtual

Member Data Documentation

SgIncidenceDirectedGraph* StaticCFG::CFG::graph_
protected

The graph data structure holding the CFG.

Definition at line 28 of file staticCFG.h.

std::map<CFGNode, SgGraphNode*> StaticCFG::CFG::all_nodes_
protected

A map from CFGNode in virtualCFG to node from staticCFG.

Definition at line 31 of file staticCFG.h.

SgNode* StaticCFG::CFG::start_
protected

The start node to begin CFG build.

Definition at line 34 of file staticCFG.h.

SgGraphNode* StaticCFG::CFG::entry_
protected

The entry node.

Definition at line 37 of file staticCFG.h.

SgGraphNode* StaticCFG::CFG::exit_
protected

The exit node.

Definition at line 40 of file staticCFG.h.

bool StaticCFG::CFG::is_filtered_
protected

A flag shows whether this CFG is filtered or not.

Definition at line 43 of file staticCFG.h.


The documentation for this class was generated from the following file: