Skip to content

StaticCFG::CFG

Synopsis

Declared in <SageIII/virtualCFG/staticCFG.h>

class [[visibility("default")]] CFG;

Member Functions

Name Description
CFG
CFG(); [constructor]
The constructor building the CFG. The valid nodes are SgProject, SgStatement, SgExpression and SgInitializedName.
~CFG
virtual ~CFG(); [destructor] [virtual]
Destructor
operator=
CFG& operator=(CFG const& other) = delete; [deleted]
Copy assignment operator
buildCFG
virtual void buildCFG(); [virtual]
Build CFG according to the 'is_filtered_' flag.
buildFilteredCFG
virtual void buildFilteredCFG(); [virtual]
Build filtered CFG which only contains interesting nodes.
buildFullCFG
virtual void buildFullCFG(); [virtual]
Build CFG for debugging.
cfgForBeginning
SgGraphNode* cfgForBeginning(SgNode* node);
cfgForEnd
SgGraphNode* cfgForEnd(SgNode* node);
cfgToDot
void cfgToDot( SgNode* node, std::string const& file_name);
Output the graph to a DOT file.
getEntry
SgGraphNode* getEntry() const;
Get the entry node of the CFG
getExit
SgGraphNode* getExit() const;
Get the exit node of the CFG
getGraph
SgIncidenceDirectedGraph* getGraph() const;
Get the pointer pointing to the graph used by static CFG.
getInEdges
std::vector<SgDirectedGraphEdge*> getInEdges(SgGraphNode* node);
getIndex
unsigned int getIndex(SgGraphNode* node) const;
Get the index of a CFG node.
getOutEdges
std::vector<SgDirectedGraphEdge*> getOutEdges(SgGraphNode* node);
isFilteredCFG
bool isFilteredCFG() const;
setFiltered
void setFiltered(bool flag);
setStart
void setStart(SgNode* node);
Set the start node for graph building. The valid nodes are SgProject, SgStatement, SgExpression and SgInitializedName.
toCFGNode
VirtualCFG::CFGNode toCFGNode(SgGraphNode* node) const;
Turn a graph node into a CFGNode which is defined in VirtualCFG namespace.
toCFGPath
VirtualCFG::CFGPath const& toCFGPath(SgDirectedGraphEdge* edge) const;
toGraphNode
SgGraphNode* toGraphNode(VirtualCFG::CFGNode& n);
Turn a CFG node into a GraphNode which is defined in VirtualCFG namespace. Returns NULL if CFGNode is not present

Protected Member Functions

Name Description
CFG
CFG( SgNode* node, bool is_filtered, bool build_now); [constructor]
addEdge
void addEdge(VirtualCFG::CFGPath const& path);
buildCFG
template< class NodeT, class EdgeT> void buildCFG( NodeT n, std::set<NodeT>& explored);
clearNodesAndEdges
void clearNodesAndEdges();
Delete all nodes and edges in the graph and release memories.
getOrCreateGraphNode
SgGraphNode* getOrCreateGraphNode(VirtualCFG::CFGNode point);
printEdge
virtual void printEdge( std::ostream& o, SgDirectedGraphEdge* edge, bool isInEdge); [virtual]
printNode
virtual void printNode( std::ostream& o, SgGraphNode* node); [virtual]
printNodePlusEdges
virtual void printNodePlusEdges( std::ostream& o, SgGraphNode* node); [virtual]
processNodes
virtual void processNodes( std::ostream& o, SgGraphNode* n, std::set<SgGraphNode*>& explored); [virtual]

Protected Data Members

Name Description
all_nodes_ A map from CFGNode in virtualCFG to node from staticCFG.
edge_paths_
entry_ The entry node.
exit_ The exit node.
graph_ The graph data structure holding the CFG.
is_filtered_ A flag shows whether this CFG is filtered or not.
node_points_
start_ The start node to begin CFG build.

Derived Classes

Name Description
CustomFilteredCFG A CFG implementation with Custom filters
InterproceduralCFG

Created with MrDocs