ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
interproceduralCFG.h
Go to the documentation of this file.
1 #ifndef INTERPROCEDURAL_CFG_H
2 #define INTERPROCEDURAL_CFG_H
3 
4 #include "staticCFG.h"
5 #include "CallGraph.h"
6 #include <map>
7 #include <set>
8 #include <string>
9 
10 
12 class SgGraphNode;
14 
15 
16 namespace StaticCFG
17 {
18 
21 
22 
24 {
25 protected:
26  virtual void buildCFG(CFGNode n,
27  std::map<CFGNode, SgGraphNode*>& all_nodes,
28  std::set<CFGNode>& explored,
29  ClassHierarchyWrapper* classHierarchy);
30 public:
32 
33  // The valid nodes are SgProject, SgStatement, SgExpression and SgInitializedName
34  InterproceduralCFG(SgNode* node, bool is_filtered = false)
35  : CFG() {
36  graph_ = NULL;
37  is_filtered_ = is_filtered;
38  start_ = node;
39  buildCFG();
40  }
42  {
43  return start_;
44  }
46  {
47  return graph_;
48  }
50  return alNodes[n];
51  }
52  // Build CFG according to the 'is_filtered_' flag.
53  virtual void buildCFG()
54  {
55  buildFullCFG();
56  }
57  std::map<CFGNode, SgGraphNode*> alNodes;
59  // Build CFG for debugging.
60  virtual void buildFullCFG();
61  // Build filtered CFG which only contains interesting nodes.
62  virtual void buildFilteredCFG();
63 };
64 
65 } // end of namespace StaticCFG
66 
67 #endif