Now that the dead ctor is gone, nothing uses the old node mapping exported by
authorChris Lattner <sabre@nondot.org>
Tue, 22 Mar 2005 00:36:51 +0000 (00:36 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 22 Mar 2005 00:36:51 +0000 (00:36 +0000)
cloneInto: make it an internally used mapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20760 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 3f93d6112dffd3fd0ad9d2c7ad08a07f071d98e8..8eef33ac63459bfb34134e280104fde9a40d51cc 100644 (file)
@@ -444,16 +444,11 @@ public:
   void computeCalleeCallerMapping(DSCallSite CS, const Function &Callee,
                                   DSGraph &CalleeGraph, NodeMapTy &NodeMap);
 
-  /// cloneInto - Clone the specified DSGraph into the current graph.  The
-  /// translated ScalarMap for the old function is filled into the OldValMap
-  /// member, and the translated ReturnNodes map is returned into ReturnNodes.
-  /// OldNodeMap contains a mapping from the original nodes to the newly cloned
-  /// nodes.
+  /// cloneInto - Clone the specified DSGraph into the current graph.
   ///
   /// The CloneFlags member controls various aspects of the cloning process.
   ///
-  void cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap,
-                 unsigned CloneFlags = 0);
+  void cloneInto(const DSGraph &G, unsigned CloneFlags = 0);
 
   /// getFunctionArgumentsForCall - Given a function that is currently in this
   /// graph, return the DSNodeHandles that correspond to the pointer-compatible
index acb4b300f94fcc2f271e3b8841565f6a47aae4f5..0a9994c41164149529ad45ee4db9ab0e48bd22a4 100644 (file)
@@ -267,10 +267,8 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
            E = SCCGraphs.end(); I != E; ++I) {
       DSGraph &G = **I;
       if (&G != SCCGraph) {
-        {
-          DSGraph::NodeMapTy NodeMap;
-          SCCGraph->cloneInto(G, NodeMap);
-        }
+        SCCGraph->cloneInto(G);
+
         // Update the DSInfo map and delete the old graph...
         for (DSGraph::retnodes_iterator I = G.retnodes_begin(),
                E = G.retnodes_end(); I != E; ++I)
@@ -412,8 +410,7 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
             // If the graph already contains the nodes for the function, don't
             // bother merging it in again.
             if (!GI->containsFunction(*I)) {
-              DSGraph::NodeMapTy NodeMap;
-              GI->cloneInto(getDSGraph(**I), NodeMap);
+              GI->cloneInto(getDSGraph(**I));
               ++NumBUInlines;
             }
 
index 7b7e62f8d09aa2f26a235cf339c977149293728d..103c6bf5392263530af1ffc07991939949e4a213 100644 (file)
@@ -175,10 +175,7 @@ unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG,
     DSGraph *NG = Stack.back();
     ValMap[NG] = ~0U;
 
-    {
-      DSGraph::NodeMapTy NodeMap;
-      FG.cloneInto(*NG, NodeMap);
-    }
+    FG.cloneInto(*NG);
 
     // Update the DSInfo map and delete the old graph...
     for (DSGraph::retnodes_iterator I = NG->retnodes_begin();
index f76811a874e600dda9a92ee11bc3221944464abd..b190b9205c247e8e05cc44ed90f1c6200825d97a 100644 (file)
@@ -1168,8 +1168,7 @@ DSGraph::DSGraph(const DSGraph &G, EquivalenceClasses<GlobalValue*> &ECs,
                  unsigned CloneFlags)
   : GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) {
   PrintAuxCalls = false;
-  NodeMapTy NodeMap;
-  cloneInto(G, NodeMap, CloneFlags);
+  cloneInto(G, CloneFlags);
 }
 
 DSGraph::~DSGraph() {
@@ -1235,12 +1234,12 @@ DSNode *DSGraph::addObjectToGraph(Value *Ptr, bool UseDeclaredType) {
 ///
 /// The CloneFlags member controls various aspects of the cloning process.
 ///
-void DSGraph::cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap,
-                        unsigned CloneFlags) {
+void DSGraph::cloneInto(const DSGraph &G, unsigned CloneFlags) {
   TIME_REGION(X, "cloneInto");
-  assert(OldNodeMap.empty() && "Returned OldNodeMap should be empty!");
   assert(&G != this && "Cannot clone graph into itself!");
 
+  NodeMapTy OldNodeMap;
+
   // Remove alloca or mod/ref bits as specified...
   unsigned BitsToClear = ((CloneFlags & StripAllocaBit)? DSNode::AllocaNode : 0)
     | ((CloneFlags & StripModRefBits)? (DSNode::Modified | DSNode::Read) : 0)
index a778d94c58a8a108e9f415cb7dc3126d8a4a9f1a..7632200b83eb3ce67bc454e2fa9c2f3d44e6519e 100644 (file)
@@ -270,8 +270,7 @@ void EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
         }
         
         // Clone this member of the equivalence class into MergedG.
-        DSGraph::NodeMapTy NodeMap;    
-        MergedG.cloneInto(CBUGraph, NodeMap);
+        MergedG.cloneInto(CBUGraph);
       }
       
       // Merge the return nodes of all functions together.
@@ -362,10 +361,7 @@ 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, NodeMap);
-    }
+    FG.cloneInto(*NG);
 
     // Update the DSInfo map and delete the old graph...
     for (DSGraph::retnodes_iterator I = NG->retnodes_begin();
index 734f26bbd2939396dade16cdd6f4f55b4f5f9045..17863d1ce0bb54154b6c3d07d32ad5053ad1b211 100644 (file)
@@ -123,10 +123,8 @@ bool Steens::runOnModule(Module &M) {
   // into this graph.
   //
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (!I->isExternal()) {
-      DSGraph::NodeMapTy NodeMap;
-      ResultGraph->cloneInto(LDS.getDSGraph(*I), NodeMap, 0);
-    }
+    if (!I->isExternal())
+      ResultGraph->cloneInto(LDS.getDSGraph(*I));
 
   ResultGraph->removeTriviallyDeadNodes();