rename method, add counterpart
authorChris Lattner <sabre@nondot.org>
Tue, 15 Mar 2005 00:58:16 +0000 (00:58 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 15 Mar 2005 00:58:16 +0000 (00:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20593 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp
lib/Analysis/DataStructure/EquivClassGraphs.cpp

index 1e47203f4237e4a7462bd24198f69d7838948041..a73a942fc7edba7083648ddb0ddbd82d56e2220c 100644 (file)
@@ -2084,9 +2084,10 @@ void DSGraph::computeNodeMapping(const DSNodeHandle &NH1,
 }
 
 
-/// computeGlobalGraphMapping - Compute the mapping of nodes in the global
-/// graph to nodes in this graph.
-void DSGraph::computeGlobalGraphMapping(NodeMapTy &NodeMap) {
+/// computeGToGGMapping - Compute the mapping of nodes in the global graph to
+/// nodes in this graph.  Note that any uses of this method are probably bugs,
+/// unless it is known that the globals graph has been merged into this graph!
+void DSGraph::computeGToGGMapping(NodeMapTy &NodeMap) {
   DSGraph &GG = *getGlobalsGraph();
 
   DSScalarMap &SM = getScalarMap();
@@ -2095,3 +2096,14 @@ void DSGraph::computeGlobalGraphMapping(NodeMapTy &NodeMap) {
     DSGraph::computeNodeMapping(SM[*I], GG.getNodeForValue(*I), NodeMap);
 }
                                 
+/// computeGGToGMapping - Compute the mapping of nodes in the global graph to
+/// nodes in this graph.
+void DSGraph::computeGGToGMapping(NodeMapTy &NodeMap) {
+  DSGraph &GG = *getGlobalsGraph();
+
+  DSScalarMap &SM = getScalarMap();
+  for (DSScalarMap::global_iterator I = SM.global_begin(),
+         E = SM.global_end(); I != E; ++I)
+    DSGraph::computeNodeMapping(GG.getNodeForValue(*I), SM[*I], NodeMap);
+}
+                                
index 58aaf2e2a5e06a88110241b0eb4e3cdf321cf737..4ada4dcca5e65000e8c05ade5962134e891a992e 100644 (file)
@@ -49,7 +49,7 @@ static void CheckAllGraphs(Module *M, GT &ECGraphs) {
         continue;  // Only check a graph once.
 
       DSGraph::NodeMapTy GlobalsGraphNodeMapping;
-      G.computeGlobalGraphMapping(GlobalsGraphNodeMapping);
+      G.computeGToGGMapping(GlobalsGraphNodeMapping);
     } 
 }
 #endif