aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-07 05:00:35 +0000
committerChris Lattner <sabre@nondot.org>2002-11-07 05:00:35 +0000
commite83cb5316b85ef9f888b186c1a533865051746f2 (patch)
tree9237cdb0bddc70e71536915ccf226e02ed289b7b /lib/Analysis
parentf17b39ab2a4f05427a2834fb177635ba10ee1186 (diff)
downloadexternal_llvm-e83cb5316b85ef9f888b186c1a533865051746f2.zip
external_llvm-e83cb5316b85ef9f888b186c1a533865051746f2.tar.gz
external_llvm-e83cb5316b85ef9f888b186c1a533865051746f2.tar.bz2
Fix problem with dangling referrers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/DataStructure/IPModRef.cpp5
-rw-r--r--lib/Analysis/IPA/IPModRef.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/Analysis/DataStructure/IPModRef.cpp b/lib/Analysis/DataStructure/IPModRef.cpp
index 0f9da42..6b7095b 100644
--- a/lib/Analysis/DataStructure/IPModRef.cpp
+++ b/lib/Analysis/DataStructure/IPModRef.cpp
@@ -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);
diff --git a/lib/Analysis/IPA/IPModRef.cpp b/lib/Analysis/IPA/IPModRef.cpp
index 0f9da42..6b7095b 100644
--- a/lib/Analysis/IPA/IPModRef.cpp
+++ b/lib/Analysis/IPA/IPModRef.cpp
@@ -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);