ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
newDDG.h
Go to the documentation of this file.
1 #ifndef _______DDG_H__________
2 #define _______DDG_H__________
3 
4 #include "cong_staticCFG.h"
5 
6 namespace SDG
7 {
8 
9 
11 struct DDGEdge
12 {
13  typedef std::vector<SgInitializedName*> VarName;
14 
16  std::set<VarName> varNames;
17 
18  void addVarName(const VarName& varName)
19  { varNames.insert(varName); }
20 };
21 
22 
23 class DataDependenceGraph : public boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS,
24  StaticCFG::CFGNodePtr, DDGEdge>
25 {
26 public:
27  typedef boost::graph_traits<DataDependenceGraph>::vertex_descriptor Vertex;
28  typedef boost::graph_traits<DataDependenceGraph>::edge_descriptor Edge;
29 
32 
35  {
36  build(cfg);
37  }
38 
41 
43  void toDot(const std::string& filename) const;
44 
45 protected:
46 
48  void writeGraphNode(std::ostream& out, const Vertex& node) const;
49 
51  void writeGraphEdge(std::ostream& out, const Edge& edge) const;
52 };
53 
54 
55 } // end of namespace SystemDependenceGraph
56 
57 
58 #endif /* _______DDG_H__________ */
59