[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Feb 7 08:09:28 PST 2005



Changes in directory llvm/lib/Analysis/DataStructure:

BottomUpClosure.cpp updated: 1.92 -> 1.93
---
Log message:

IndCallGraphMap is now a pointer to a new'd map.


---
Diffs of the changes:  (+6 -3)

 BottomUpClosure.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.92 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.93
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.92	Fri Feb  4 13:59:49 2005
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp	Mon Feb  7 10:09:15 2005
@@ -40,6 +40,9 @@
   GlobalsGraph = new DSGraph(LocalDSA.getGlobalsGraph());
   GlobalsGraph->setPrintAuxCalls();
 
+  IndCallGraphMap = new std::map<std::vector<Function*>,
+                           std::pair<DSGraph*, std::vector<DSNodeHandle> > >();
+
   std::vector<Function*> Stack;
   hash_map<Function*, unsigned> ValMap;
   unsigned NextID = 1;
@@ -64,11 +67,11 @@
   // If we computed any temporary indcallgraphs, free them now.
   for (std::map<std::vector<Function*>,
          std::pair<DSGraph*, std::vector<DSNodeHandle> > >::iterator I =
-         IndCallGraphMap.begin(), E = IndCallGraphMap.end(); I != E; ++I) {
+         IndCallGraphMap->begin(), E = IndCallGraphMap->end(); I != E; ++I) {
     I->second.second.clear();  // Drop arg refs into the graph.
     delete I->second.first;
   }
-  IndCallGraphMap.clear();
+  delete IndCallGraphMap;
 
   // At the end of the bottom-up pass, the globals graph becomes complete.
   // FIXME: This is not the right way to do this, but it is sorta better than
@@ -340,7 +343,7 @@
         // See if we already computed a graph for this set of callees.
         std::sort(CalledFuncs.begin(), CalledFuncs.end());
         std::pair<DSGraph*, std::vector<DSNodeHandle> > &IndCallGraph =
-          IndCallGraphMap[CalledFuncs];
+          (*IndCallGraphMap)[CalledFuncs];
 
         if (IndCallGraph.first == 0) {
           std::vector<Function*>::iterator I = CalledFuncs.begin(),






More information about the llvm-commits mailing list