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

#include <SDG.h>

Inheritance diagram for SDG::SystemDependenceGraph:
Collaboration diagram for SDG::SystemDependenceGraph:

Classes

struct  CallSiteInfo
 

Public Types

typedef boost::graph_traits
< SystemDependenceGraph >
::vertex_descriptor 
Vertex
 
typedef boost::graph_traits
< SystemDependenceGraph >
::edge_descriptor 
Edge
 

Public Member Functions

 SystemDependenceGraph (SgProject *project, StaticCFG::CFGNodeFilter filter)
 
void build ()
 Build the SDG. More...
 
void setCFGNodeFilter (StaticCFG::CFGNodeFilter filter)
 
void setDefUseChainsGenerator (const DefUseChainsGen &defUseChainsGen)
 
void toDot (const std::string &filename) const
 Write the PDG to a dot file. More...
 

Protected Types

typedef StaticCFG::ControlFlowGraph CFG
 
typedef CFG::Vertex CFGVertex
 
typedef CFG::Edge CFGEdge
 
typedef boost::function< void(SgProject
*, DefUseChains &)> 
DefUseChainsGen
 

Protected Member Functions

Vertex addVertex (SDGNode *sdgNode)
 
Edge addEdge (Vertex src, Vertex tgt, SDGEdge *sdgEdge)
 
void addTrueCDEdge (Vertex src, Vertex tgt)
 Add a Control Dependence edge with True label. More...
 
void addControlDependenceEdges (const boost::unordered_map< CFGVertex, Vertex > &cfgVerticesToSdgVertices, const CFG &cfg, Vertex entry)
 
void addDataDependenceEdges (const boost::unordered_map< SgNode *, Vertex > &astNodesToSdgVertices, const std::vector< CallSiteInfo > &callSiteInfo, const std::map< SgNode *, Vertex > &formalOutPara)
 
void writeGraphNode (std::ostream &out, const Vertex &vertex) const
 This function helps to write the DOT file for vertices. More...
 
void writeGraphEdge (std::ostream &out, const Edge &edge) const
 This function helps to write the DOT file for edges. More...
 
void writeGraphProperty (std::ostream &out) const
 This function helps to write the DOT file for the whole graph. More...
 

Protected Attributes

SgProjectproject_
 The ROSE project object. More...
 
StaticCFG::CFGNodeFilter cfgNodefilter_
 The CFG node filter which controls which AST nodes appear in CFG. More...
 
std::map
< SgFunctionDeclaration *, CFG * > 
functionsToCFGs_
 A table mapping each function to its CFG. More...
 
std::map
< SgFunctionDeclaration
*, Vertex
functionsToEntries_
 A table mapping each function to its entry in SDG. More...
 
boost::function< void(SgProject
*, DefUseChains &)> 
defUseChainGenerator_
 

Detailed Description

Definition at line 93 of file SDG.h.

Member Typedef Documentation

typedef boost::graph_traits<SystemDependenceGraph>::vertex_descriptor SDG::SystemDependenceGraph::Vertex

Definition at line 97 of file SDG.h.

typedef boost::graph_traits<SystemDependenceGraph>::edge_descriptor SDG::SystemDependenceGraph::Edge

Definition at line 98 of file SDG.h.

Definition at line 101 of file SDG.h.

Definition at line 102 of file SDG.h.

Definition at line 103 of file SDG.h.

typedef boost::function<void(SgProject*, DefUseChains&)> SDG::SystemDependenceGraph::DefUseChainsGen
protected

Definition at line 105 of file SDG.h.

Constructor & Destructor Documentation

SDG::SystemDependenceGraph::SystemDependenceGraph ( SgProject project,
StaticCFG::CFGNodeFilter  filter 
)
inline

Definition at line 140 of file SDG.h.

Member Function Documentation

void SDG::SystemDependenceGraph::build ( )

Build the SDG.

void SDG::SystemDependenceGraph::setCFGNodeFilter ( StaticCFG::CFGNodeFilter  filter)
inline

Definition at line 147 of file SDG.h.

References cfgNodefilter_.

void SDG::SystemDependenceGraph::setDefUseChainsGenerator ( const DefUseChainsGen defUseChainsGen)
inline

Definition at line 150 of file SDG.h.

References defUseChainGenerator_.

void SDG::SystemDependenceGraph::toDot ( const std::string &  filename) const

Write the PDG to a dot file.

Vertex SDG::SystemDependenceGraph::addVertex ( SDGNode sdgNode)
inlineprotected

Definition at line 158 of file SDG.h.

Edge SDG::SystemDependenceGraph::addEdge ( Vertex  src,
Vertex  tgt,
SDGEdge sdgEdge 
)
inlineprotected

Definition at line 165 of file SDG.h.

void SDG::SystemDependenceGraph::addTrueCDEdge ( Vertex  src,
Vertex  tgt 
)
protected

Add a Control Dependence edge with True label.

void SDG::SystemDependenceGraph::addControlDependenceEdges ( const boost::unordered_map< CFGVertex, Vertex > &  cfgVerticesToSdgVertices,
const CFG cfg,
Vertex  entry 
)
protected
void SDG::SystemDependenceGraph::addDataDependenceEdges ( const boost::unordered_map< SgNode *, Vertex > &  astNodesToSdgVertices,
const std::vector< CallSiteInfo > &  callSiteInfo,
const std::map< SgNode *, Vertex > &  formalOutPara 
)
protected
void SDG::SystemDependenceGraph::writeGraphNode ( std::ostream &  out,
const Vertex vertex 
) const
protected

This function helps to write the DOT file for vertices.

void SDG::SystemDependenceGraph::writeGraphEdge ( std::ostream &  out,
const Edge edge 
) const
protected

This function helps to write the DOT file for edges.

void SDG::SystemDependenceGraph::writeGraphProperty ( std::ostream &  out) const
protected

This function helps to write the DOT file for the whole graph.

Member Data Documentation

SgProject* SDG::SystemDependenceGraph::project_
protected

The ROSE project object.

Definition at line 111 of file SDG.h.

StaticCFG::CFGNodeFilter SDG::SystemDependenceGraph::cfgNodefilter_
protected

The CFG node filter which controls which AST nodes appear in CFG.

Definition at line 114 of file SDG.h.

Referenced by setCFGNodeFilter().

std::map<SgFunctionDeclaration*, CFG*> SDG::SystemDependenceGraph::functionsToCFGs_
protected

A table mapping each function to its CFG.

Definition at line 117 of file SDG.h.

std::map<SgFunctionDeclaration*, Vertex> SDG::SystemDependenceGraph::functionsToEntries_
protected

A table mapping each function to its entry in SDG.

Definition at line 120 of file SDG.h.

boost::function<void(SgProject*, DefUseChains&)> SDG::SystemDependenceGraph::defUseChainGenerator_
protected

Definition at line 122 of file SDG.h.

Referenced by setDefUseChainsGenerator().


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