From bcc70bcb258d9078f4edccfd7b19b2ab55e57d4b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 7 Feb 2005 16:09:15 +0000 Subject: [PATCH] IndCallGraphMap is now a pointer to a new'd map. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20065 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DataStructure/BottomUpClosure.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp index e3c8c49d421..6d3c4b0a1a4 100644 --- a/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -40,6 +40,9 @@ bool BUDataStructures::runOnModule(Module &M) { GlobalsGraph = new DSGraph(LocalDSA.getGlobalsGraph()); GlobalsGraph->setPrintAuxCalls(); + IndCallGraphMap = new std::map, + std::pair > >(); + std::vector Stack; hash_map ValMap; unsigned NextID = 1; @@ -64,11 +67,11 @@ bool BUDataStructures::runOnModule(Module &M) { // If we computed any temporary indcallgraphs, free them now. for (std::map, std::pair > >::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 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) { // See if we already computed a graph for this set of callees. std::sort(CalledFuncs.begin(), CalledFuncs.end()); std::pair > &IndCallGraph = - IndCallGraphMap[CalledFuncs]; + (*IndCallGraphMap)[CalledFuncs]; if (IndCallGraph.first == 0) { std::vector::iterator I = CalledFuncs.begin(),