|
ROSE 0.11.145.354
|
A class holding a Control Flow Graph.
Definition at line 23 of file boostGraphCFG.h.
#include <midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h>


Classes | |
| struct | EdgeCopier |
| This class is used to copy edges when calling copy_graph(). More... | |
| struct | VertexCopier |
| This class is used to copy vertices when calling copy_graph(). More... | |
Public Types | |
| typedef boost::graph_traits< CFG< CFGNodeT, CFGEdgeT > > | GraphTraits |
| typedef CFGNodeT | CFGNodeType |
| typedef CFGEdgeT | CFGEdgeType |
| typedef boost::shared_ptr< CFGNodeType > | CFGNodePtr |
| typedef boost::shared_ptr< CFGEdgeType > | CFGEdgePtr |
| typedef GraphTraits::vertex_descriptor | Vertex |
| typedef GraphTraits::edge_descriptor | Edge |
| typedef std::map< Vertex, Vertex > | VertexVertexMap |
Public Member Functions | |
| CFG () | |
| The default constructor. | |
| CFG (SgFunctionDefinition *funcDef) | |
| The constructor building the CFG. | |
| void | build (SgFunctionDefinition *funcDef) |
| Build the actual CFG for the given function. | |
| SgFunctionDefinition * | getFunctionDefinition () const |
| Get the function definition of this CFG. | |
| const Vertex & | getEntry () const |
| Get the entry node of the CFG. | |
| const Vertex & | getExit () const |
| Get the exit node of the CFG. | |
| const VertexVertexMap & | getDominatorTree () |
| Build the dominator tree of this CFG. | |
| const VertexVertexMap & | getPostdominatorTree () |
| Build the postdominator tree of this CFG. | |
| CFG< CFGNodeT, CFGEdgeT > | makeReverseCopy () const |
| Build a reverse CFG. | |
| std::vector< CFGNodePtr > | getAllNodes () const |
| Get all CFG nodes in this graph. | |
| std::vector< CFGEdgePtr > | getAllEdges () const |
| Get all CFG edges in this graph. | |
| Vertex | getVertexForNode (const CFGNodeType &node) const |
| Given a CFG node, returns the corresponding vertex in the graph. | |
| std::vector< Edge > | getAllBackEdges () |
| Get all back edges in the CFG. A back edge is one whose target dominates its source. | |
| std::vector< Vertex > | getAllLoopHeaders () |
| Get all loop headers in this CFG. A natural loop only has one header. | |
Protected Member Functions | |
| void | buildCFG (const CFGNodeType &node, std::map< CFGNodeType, Vertex > &nodesAdded, std::set< CFGNodeType > &nodesProcessed) |
| A internal funtion which builds the actual CFG (boost::graph). | |
| void | setEntryAndExit () |
| Find the entry and exit of this CFG and set the corresponding members. | |
Protected Attributes | |
| SgFunctionDefinition * | funcDef_ |
| The function definition of this CFG. | |
| Vertex | entry_ |
| The entry node. | |
| Vertex | exit_ |
| The exit node. | |
| std::map< CFGNodeType, Vertex > | nodesToVertices_ |
| A map from a CFG node to the corresponding vertex. | |
| VertexVertexMap | dominatorTree_ |
| The dominator tree of this CFG. | |
| VertexVertexMap | postdominatorTree_ |
| The postdominator tree of this CFG. | |
| typedef boost::graph_traits<CFG<CFGNodeT, CFGEdgeT> > ssa_private::CFG< CFGNodeT, CFGEdgeT >::GraphTraits |
Definition at line 27 of file boostGraphCFG.h.
| typedef CFGNodeT ssa_private::CFG< CFGNodeT, CFGEdgeT >::CFGNodeType |
Definition at line 30 of file boostGraphCFG.h.
| typedef CFGEdgeT ssa_private::CFG< CFGNodeT, CFGEdgeT >::CFGEdgeType |
Definition at line 31 of file boostGraphCFG.h.
| typedef boost::shared_ptr<CFGNodeType> ssa_private::CFG< CFGNodeT, CFGEdgeT >::CFGNodePtr |
Definition at line 33 of file boostGraphCFG.h.
| typedef boost::shared_ptr<CFGEdgeType> ssa_private::CFG< CFGNodeT, CFGEdgeT >::CFGEdgePtr |
Definition at line 34 of file boostGraphCFG.h.
| typedef GraphTraits::vertex_descriptor ssa_private::CFG< CFGNodeT, CFGEdgeT >::Vertex |
Definition at line 36 of file boostGraphCFG.h.
| typedef GraphTraits::edge_descriptor ssa_private::CFG< CFGNodeT, CFGEdgeT >::Edge |
Definition at line 37 of file boostGraphCFG.h.
| typedef std::map<Vertex, Vertex> ssa_private::CFG< CFGNodeT, CFGEdgeT >::VertexVertexMap |
Definition at line 39 of file boostGraphCFG.h.
|
inline |
The default constructor.
Definition at line 64 of file boostGraphCFG.h.
|
inlineexplicit |
The constructor building the CFG.
Definition at line 72 of file boostGraphCFG.h.
References ssa_private::CFG< CFGNodeT, CFGEdgeT >::build().
| void ssa_private::CFG< CFGNodeT, CFGEdgeT >::build | ( | SgFunctionDefinition * | funcDef | ) |
Build the actual CFG for the given function.
Definition at line 163 of file boostGraphCFG.h.
References SgNode::cfgForBeginning().
Referenced by ssa_private::CFG< CFGNodeT, CFGEdgeT >::CFG().
|
inline |
Get the function definition of this CFG.
Definition at line 84 of file boostGraphCFG.h.
References ssa_private::CFG< CFGNodeT, CFGEdgeT >::funcDef_.
|
inline |
Get the entry node of the CFG.
Definition at line 88 of file boostGraphCFG.h.
References ssa_private::CFG< CFGNodeT, CFGEdgeT >::entry_.
|
inline |
Get the exit node of the CFG.
Definition at line 92 of file boostGraphCFG.h.
References ssa_private::CFG< CFGNodeT, CFGEdgeT >::exit_.
| const CFG< CFGNodeT, CFGEdgeT >::VertexVertexMap & ssa_private::CFG< CFGNodeT, CFGEdgeT >::getDominatorTree | ( | ) |
Build the dominator tree of this CFG.
Definition at line 279 of file boostGraphCFG.h.
| const CFG< CFGNodeT, CFGEdgeT >::VertexVertexMap & ssa_private::CFG< CFGNodeT, CFGEdgeT >::getPostdominatorTree | ( | ) |
Build the postdominator tree of this CFG.
Definition at line 292 of file boostGraphCFG.h.
| CFG< CFGNodeT, CFGEdgeT > ssa_private::CFG< CFGNodeT, CFGEdgeT >::makeReverseCopy | ( | ) | const |
Build a reverse CFG.
Definition at line 305 of file boostGraphCFG.h.
References ssa_private::CFG< CFGNodeT, CFGEdgeT >::entry_, and ssa_private::CFG< CFGNodeT, CFGEdgeT >::exit_.
| std::vector< typename CFG< CFGNodeT, CFGEdgeT >::CFGNodePtr > ssa_private::CFG< CFGNodeT, CFGEdgeT >::getAllNodes | ( | ) | const |
Get all CFG nodes in this graph.
Definition at line 321 of file boostGraphCFG.h.
| std::vector< typename CFG< CFGNodeT, CFGEdgeT >::CFGEdgePtr > ssa_private::CFG< CFGNodeT, CFGEdgeT >::getAllEdges | ( | ) | const |
Get all CFG edges in this graph.
Definition at line 331 of file boostGraphCFG.h.
| CFG< CFGNodeT, CFGEdgeT >::Vertex ssa_private::CFG< CFGNodeT, CFGEdgeT >::getVertexForNode | ( | const CFGNodeType & | node | ) | const |
Given a CFG node, returns the corresponding vertex in the graph.
Returns Vertex::null_vertex() if the given node is not in the graph
Definition at line 340 of file boostGraphCFG.h.
| std::vector< typename CFG< CFGNodeT, CFGEdgeT >::Edge > ssa_private::CFG< CFGNodeT, CFGEdgeT >::getAllBackEdges | ( | ) |
Get all back edges in the CFG. A back edge is one whose target dominates its source.
Definition at line 353 of file boostGraphCFG.h.
| std::vector< typename CFG< CFGNodeT, CFGEdgeT >::Vertex > ssa_private::CFG< CFGNodeT, CFGEdgeT >::getAllLoopHeaders | ( | ) |
Get all loop headers in this CFG. A natural loop only has one header.
Definition at line 382 of file boostGraphCFG.h.
|
protected |
A internal funtion which builds the actual CFG (boost::graph).
Definition at line 216 of file boostGraphCFG.h.
|
protected |
Find the entry and exit of this CFG and set the corresponding members.
Definition at line 187 of file boostGraphCFG.h.
|
protected |
The function definition of this CFG.
Definition at line 44 of file boostGraphCFG.h.
Referenced by ssa_private::CFG< CFGNodeT, CFGEdgeT >::getFunctionDefinition().
|
protected |
The entry node.
Definition at line 47 of file boostGraphCFG.h.
Referenced by ssa_private::CFG< CFGNodeT, CFGEdgeT >::getEntry(), and ssa_private::CFG< CFGNodeT, CFGEdgeT >::makeReverseCopy().
|
protected |
The exit node.
Definition at line 50 of file boostGraphCFG.h.
Referenced by ssa_private::CFG< CFGNodeT, CFGEdgeT >::getExit(), and ssa_private::CFG< CFGNodeT, CFGEdgeT >::makeReverseCopy().
|
protected |
A map from a CFG node to the corresponding vertex.
Definition at line 53 of file boostGraphCFG.h.
|
protected |
The dominator tree of this CFG.
Definition at line 56 of file boostGraphCFG.h.
|
protected |
The postdominator tree of this CFG.
Definition at line 59 of file boostGraphCFG.h.