now that the second argument is always this->ReturnNodes, don't bother passing it.
authorChris Lattner <sabre@nondot.org>
Tue, 22 Mar 2005 00:29:44 +0000 (00:29 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 22 Mar 2005 00:29:44 +0000 (00:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20758 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DataStructure/DSGraph.h
lib/Analysis/DataStructure/BottomUpClosure.cpp
lib/Analysis/DataStructure/CompleteBottomUp.cpp
lib/Analysis/DataStructure/DataStructure.cpp
lib/Analysis/DataStructure/EquivClassGraphs.cpp
lib/Analysis/DataStructure/Steensgaard.cpp

index a0d06add3b9c584d5a507a86367bc5a2a8b3caa7..d6e478841e30eecf3ddc2f6e723eadd48e8eb219 100644 (file)
@@ -454,8 +454,7 @@ public:
   ///
   /// The CloneFlags member controls various aspects of the cloning process.
   ///
-  void cloneInto(const DSGraph &G,
-                 ReturnNodesTy &OldReturnNodes, NodeMapTy &OldNodeMap,
+  void cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap,
                  unsigned CloneFlags = 0);
 
   /// getFunctionArgumentsForCall - Given a function that is currently in this
index 2dae94323192e23451fe81eecf8e40045efa526a..acb4b300f94fcc2f271e3b8841565f6a47aae4f5 100644 (file)
@@ -269,7 +269,7 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
       if (&G != SCCGraph) {
         {
           DSGraph::NodeMapTy NodeMap;
-          SCCGraph->cloneInto(G, SCCGraph->getReturnNodes(), NodeMap);
+          SCCGraph->cloneInto(G, NodeMap);
         }
         // Update the DSInfo map and delete the old graph...
         for (DSGraph::retnodes_iterator I = G.retnodes_begin(),
@@ -413,7 +413,7 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
             // bother merging it in again.
             if (!GI->containsFunction(*I)) {
               DSGraph::NodeMapTy NodeMap;
-              GI->cloneInto(getDSGraph(**I), GI->getReturnNodes(), NodeMap);
+              GI->cloneInto(getDSGraph(**I), NodeMap);
               ++NumBUInlines;
             }
 
index bc8e04c100a28df0d7c3d7a72be0415bfaee6659..7b7e62f8d09aa2f26a235cf339c977149293728d 100644 (file)
@@ -175,8 +175,10 @@ unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG,
     DSGraph *NG = Stack.back();
     ValMap[NG] = ~0U;
 
-    DSGraph::NodeMapTy NodeMap;
-    FG.cloneInto(*NG, FG.getReturnNodes(), NodeMap);
+    {
+      DSGraph::NodeMapTy NodeMap;
+      FG.cloneInto(*NG, NodeMap);
+    }
 
     // Update the DSInfo map and delete the old graph...
     for (DSGraph::retnodes_iterator I = NG->retnodes_begin();
index 5cd37840c820feb505af98eaa31de5b813a7d3cd..e847280637bac44a2ff9a16f59dfb9f178708591 100644 (file)
@@ -1169,14 +1169,14 @@ DSGraph::DSGraph(const DSGraph &G, EquivalenceClasses<GlobalValue*> &ECs,
   : GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) {
   PrintAuxCalls = false;
   NodeMapTy NodeMap;
-  cloneInto(G, ReturnNodes, NodeMap, CloneFlags);
+  cloneInto(G, NodeMap, CloneFlags);
 }
 
 DSGraph::DSGraph(const DSGraph &G, NodeMapTy &NodeMap,
                  EquivalenceClasses<GlobalValue*> &ECs)
   : GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) {
   PrintAuxCalls = false;
-  cloneInto(G, ReturnNodes, NodeMap);
+  cloneInto(G, NodeMap);
 }
 
 DSGraph::~DSGraph() {
@@ -1242,8 +1242,7 @@ DSNode *DSGraph::addObjectToGraph(Value *Ptr, bool UseDeclaredType) {
 ///
 /// The CloneFlags member controls various aspects of the cloning process.
 ///
-void DSGraph::cloneInto(const DSGraph &G,
-                        ReturnNodesTy &OldReturnNodes, NodeMapTy &OldNodeMap,
+void DSGraph::cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap,
                         unsigned CloneFlags) {
   TIME_REGION(X, "cloneInto");
   assert(OldNodeMap.empty() && "Returned OldNodeMap should be empty!");
@@ -1306,9 +1305,9 @@ void DSGraph::cloneInto(const DSGraph &G,
     const DSNodeHandle &Ret = I->second;
     DSNodeHandle &MappedRet = OldNodeMap[Ret.getNode()];
     DSNode *MappedRetN = MappedRet.getNode();
-    OldReturnNodes.insert(std::make_pair(I->first,
-                          DSNodeHandle(MappedRetN,
-                                       MappedRet.getOffset()+Ret.getOffset())));
+    ReturnNodes.insert(std::make_pair(I->first,
+                                      DSNodeHandle(MappedRetN,
+                                     MappedRet.getOffset()+Ret.getOffset())));
   }
 }
 
index 83b9d9a3f8d5a38fa0f67b3c958f4707f68c42fd..a778d94c58a8a108e9f415cb7dc3126d8a4a9f1a 100644 (file)
@@ -271,7 +271,7 @@ void EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
         
         // Clone this member of the equivalence class into MergedG.
         DSGraph::NodeMapTy NodeMap;    
-        MergedG.cloneInto(CBUGraph, MergedG.getReturnNodes(), NodeMap, 0);
+        MergedG.cloneInto(CBUGraph, NodeMap);
       }
       
       // Merge the return nodes of all functions together.
@@ -362,8 +362,10 @@ processSCC(DSGraph &FG, std::vector<DSGraph*> &Stack, unsigned &NextID,
 
     // If the SCC found is not the same as those found in CBU, make sure to
     // merge the graphs as appropriate.
-    DSGraph::NodeMapTy NodeMap;
-    FG.cloneInto(*NG, FG.getReturnNodes(), NodeMap);
+    {
+      DSGraph::NodeMapTy NodeMap;
+      FG.cloneInto(*NG, NodeMap);
+    }
 
     // Update the DSInfo map and delete the old graph...
     for (DSGraph::retnodes_iterator I = NG->retnodes_begin();
index 8c76189b45f8d66db65a233242dd9d6760d352fa..734f26bbd2939396dade16cdd6f4f55b4f5f9045 100644 (file)
@@ -125,8 +125,7 @@ bool Steens::runOnModule(Module &M) {
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isExternal()) {
       DSGraph::NodeMapTy NodeMap;
-      ResultGraph->cloneInto(LDS.getDSGraph(*I), ResultGraph->getReturnNodes(),
-                             NodeMap, 0);
+      ResultGraph->cloneInto(LDS.getDSGraph(*I), NodeMap, 0);
     }
 
   ResultGraph->removeTriviallyDeadNodes();