Fix problem with dangling referrers
authorChris Lattner <sabre@nondot.org>
Thu, 7 Nov 2002 05:00:35 +0000 (05:00 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 7 Nov 2002 05:00:35 +0000 (05:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4595 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/IPModRef.cpp
lib/Analysis/IPA/IPModRef.cpp

index 0f9da42531783c4a4148584f3818def31e521fd0..6b7095bcabd6626f35acff4a0be45b7e09b824d2 100644 (file)
@@ -158,6 +158,9 @@ FunctionModRefInfo::computeModRef(const CallInst& callInst)
       if (csgNodes[i]->isRead())
         callModRefInfo->setNodeIsRef(getNodeId(origNodes[i]));
     }
+
+  // Drop nodemap before we delete the graph...
+  NodeMap.clear();
   delete csgp;
 }
 
@@ -194,7 +197,6 @@ void FunctionModRefInfo::dump() const
 // class IPModRef: An interprocedural pass that computes IP Mod/Ref info.
 //----------------------------------------------------------------------------
 
-
 // Free the FunctionModRefInfo objects cached in funcToModRefInfoMap.
 // 
 void IPModRef::releaseMemory()
@@ -215,6 +217,7 @@ void IPModRef::releaseMemory()
 bool IPModRef::run(Module &theModule)
 {
   M = &theModule;
+
   for (Module::const_iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
     if (! FI->isExternal())
       getFuncInfo(*FI, /*computeIfMissing*/ true);
index 0f9da42531783c4a4148584f3818def31e521fd0..6b7095bcabd6626f35acff4a0be45b7e09b824d2 100644 (file)
@@ -158,6 +158,9 @@ FunctionModRefInfo::computeModRef(const CallInst& callInst)
       if (csgNodes[i]->isRead())
         callModRefInfo->setNodeIsRef(getNodeId(origNodes[i]));
     }
+
+  // Drop nodemap before we delete the graph...
+  NodeMap.clear();
   delete csgp;
 }
 
@@ -194,7 +197,6 @@ void FunctionModRefInfo::dump() const
 // class IPModRef: An interprocedural pass that computes IP Mod/Ref info.
 //----------------------------------------------------------------------------
 
-
 // Free the FunctionModRefInfo objects cached in funcToModRefInfoMap.
 // 
 void IPModRef::releaseMemory()
@@ -215,6 +217,7 @@ void IPModRef::releaseMemory()
 bool IPModRef::run(Module &theModule)
 {
   M = &theModule;
+
   for (Module::const_iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
     if (! FI->isExternal())
       getFuncInfo(*FI, /*computeIfMissing*/ true);