rename a method add a data structure.
authorChris Lattner <sabre@nondot.org>
Mon, 21 Mar 2005 04:46:35 +0000 (04:46 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 21 Mar 2005 04:46:35 +0000 (04:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20722 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DataStructure/DataStructure.h

index 215c4a5409d61a6c63e862e85193077aa327d790..15ae2dc9452e332f17fbd74a23511c0605667c74 100644 (file)
@@ -26,6 +26,7 @@ class Type;
 class Instruction;
 class GlobalValue;
 class DSGraph;
+class DSCallSite;
 class DSNode;
 class DSNodeHandle;
 
@@ -181,6 +182,25 @@ class TDDataStructures : public ModulePass {
   /// GlobalECs - The equivalence classes for each global value that is merged
   /// with other global values in the DSGraphs.
   EquivalenceClasses<GlobalValue*> GlobalECs;
+
+  /// CallerCallEdges - For a particular graph, we keep a list of these records
+  /// which indicates which graphs call this function and from where.
+  struct CallerCallEdge {
+    DSGraph *CallerGraph;        // The graph of the caller function.
+    const DSCallSite *CS;        // The actual call site.
+    Function *CalledFunction;    // The actual function being called.
+
+    CallerCallEdge(DSGraph *G, const DSCallSite *cs, Function *CF)
+      : CallerGraph(G), CS(cs), CalledFunction(CF) {}
+
+    bool operator<(const CallerCallEdge &RHS) const {
+      return CallerGraph < RHS.CallerGraph ||
+            (CallerGraph == RHS.CallerGraph && CS < RHS.CS);
+    }
+  };
+
+  std::map<DSGraph*, std::vector<CallerCallEdge> > CallerEdges;
+
 public:
   ~TDDataStructures() { releaseMyMemory(); }
 
@@ -227,7 +247,7 @@ private:
   void markReachableFunctionsExternallyAccessible(DSNode *N,
                                                   hash_set<DSNode*> &Visited);
 
-  void inlineGraphIntoCallees(DSGraph &G);
+  void InlineCallersIntoGraph(DSGraph &G);
   DSGraph &getOrCreateDSGraph(Function &F);
   void ComputePostOrder(Function &F, hash_set<DSGraph*> &Visited,
                         std::vector<DSGraph*> &PostOrder,