ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PtrAliasAnalysis.h
Go to the documentation of this file.
1 #ifndef PTR_ALIAS_ANALYSIS
2 #define PTR_ALIAS_ANALYSIS
3 #include "ClassHierarchyGraph.h"
6 
7 
8 using namespace std;
9 using namespace boost;
10 
14 
15 protected:
18 
20  boost::unordered_map<SgFunctionDeclaration *, IntraProcAliasAnalysis *> intraAliases;
21 
23  boost::unordered_map<SgExpression *, std::vector<SgFunctionDeclaration*> > resolver;
24 
27 
29 public:
31  enum COLOR {WHITE=0, GREY, BLACK};
33  enum TRAVERSAL_TYPE {TOPOLOGICAL=0, REVERSE_TOPOLOGICAL};
34 
35  PtrAliasAnalysis(SgProject *__project);
37  void run();
39  void getFunctionDeclarations(std::vector<SgFunctionDeclaration*> &);
41  bool runAndCheckIntraProcAnalysis(SgFunctionDeclaration *);
42 
43 private:
44  void SortCallGraphRecursive(SgFunctionDeclaration* targetFunction, SgIncidenceDirectedGraph* callGraph,
45  boost::unordered_map<SgFunctionDeclaration*, SgGraphNode*> &graphNodeToFunction, boost::unordered_map<SgGraphNode*,
46  PtrAliasAnalysis::COLOR> &colors, std::vector<SgFunctionDeclaration*> &processingOrder,
48 
49  void SortCallGraphNodes(SgFunctionDeclaration* targetFunction, SgIncidenceDirectedGraph* callGraph,
50  boost::unordered_map<SgFunctionDeclaration*, SgGraphNode*> &graphNodeToFunction,
51  std::vector<SgFunctionDeclaration*> &processingOrder, PtrAliasAnalysis::TRAVERSAL_TYPE order);
52 
53  void computeCallGraphNodes(SgFunctionDeclaration* targetFunction, SgIncidenceDirectedGraph* callGraph,
54  std::vector<SgFunctionDeclaration*> &processingOrder, PtrAliasAnalysis::TRAVERSAL_TYPE order);
55 
56  // Order of performing Dataflow Analysis
58 };
59 
60 #endif