Added a first-class representation for each call site that can be
authorVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 20 Oct 2002 18:08:55 +0000 (18:08 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 20 Oct 2002 18:08:55 +0000 (18:08 +0000)
used in the DS graphs in DSGraph.h.  With that, the special-purpose
class BUDataStructure::CallSite is no longer needed here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4229 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DataStructure.h
include/llvm/Analysis/DataStructure/DataStructure.h

index f154a6e629cf38ef889e02f142d2a8c2cb4a1df6..2dc4ce4d1e8701e5b6fbf5c80c6cff6ce35b5322 100644 (file)
@@ -12,6 +12,7 @@
 class Type;
 class DSGraph;
 class DSNodeHandle;
+class DSCallSite;
 class LocalDataStructures;     // A collection of local graphs for a program
 class BUDataStructures;        // A collection of bu graphs for a program
 class TDDataStructures;        // A collection of td graphs for a program
@@ -63,19 +64,10 @@ public:
 // only performs a "Bottom Up" propogation (hence the name).
 //
 class BUDataStructures : public Pass {
-public:
-  struct CallSite {
-    Function *Caller;
-    std::vector<DSNodeHandle> Context;
-
-    CallSite(Function &C, const std::vector<DSNodeHandle> &Con)
-      : Caller(&C), Context(Con) {}
-  };
-
 private:
   // DSInfo, one graph for each function
   std::map<const Function*, DSGraph*> DSInfo;
-  std::map<const Function*, std::vector<CallSite> > CallSites;
+  std::map<const Function*, std::vector<DSCallSite> > CallSites;
 public:
   ~BUDataStructures() { releaseMemory(); }
 
@@ -88,8 +80,8 @@ public:
     return *I->second;
   }
 
-  const std::vector<CallSite> *getCallSites(const Function &F) const {
-    std::map<const Function*, std::vector<CallSite> >::const_iterator I
+  const std::vector<DSCallSite> *getCallSites(const Function &F) const {
+    std::map<const Function*, std::vector<DSCallSite> >::const_iterator I
       = CallSites.find(&F);
     return I != CallSites.end() ? &I->second : 0;
   }
@@ -143,7 +135,7 @@ private:
   DSGraph &calculateGraph(Function &F);
 
   void ResolveCallSite(DSGraph &Graph,
-                       const BUDataStructures::CallSite &CallSite);
+                       const DSCallSite &CallSite);
 };
 
 #if 0
index f154a6e629cf38ef889e02f142d2a8c2cb4a1df6..2dc4ce4d1e8701e5b6fbf5c80c6cff6ce35b5322 100644 (file)
@@ -12,6 +12,7 @@
 class Type;
 class DSGraph;
 class DSNodeHandle;
+class DSCallSite;
 class LocalDataStructures;     // A collection of local graphs for a program
 class BUDataStructures;        // A collection of bu graphs for a program
 class TDDataStructures;        // A collection of td graphs for a program
@@ -63,19 +64,10 @@ public:
 // only performs a "Bottom Up" propogation (hence the name).
 //
 class BUDataStructures : public Pass {
-public:
-  struct CallSite {
-    Function *Caller;
-    std::vector<DSNodeHandle> Context;
-
-    CallSite(Function &C, const std::vector<DSNodeHandle> &Con)
-      : Caller(&C), Context(Con) {}
-  };
-
 private:
   // DSInfo, one graph for each function
   std::map<const Function*, DSGraph*> DSInfo;
-  std::map<const Function*, std::vector<CallSite> > CallSites;
+  std::map<const Function*, std::vector<DSCallSite> > CallSites;
 public:
   ~BUDataStructures() { releaseMemory(); }
 
@@ -88,8 +80,8 @@ public:
     return *I->second;
   }
 
-  const std::vector<CallSite> *getCallSites(const Function &F) const {
-    std::map<const Function*, std::vector<CallSite> >::const_iterator I
+  const std::vector<DSCallSite> *getCallSites(const Function &F) const {
+    std::map<const Function*, std::vector<DSCallSite> >::const_iterator I
       = CallSites.find(&F);
     return I != CallSites.end() ? &I->second : 0;
   }
@@ -143,7 +135,7 @@ private:
   DSGraph &calculateGraph(Function &F);
 
   void ResolveCallSite(DSGraph &Graph,
-                       const BUDataStructures::CallSite &CallSite);
+                       const DSCallSite &CallSite);
 };
 
 #if 0