diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-07 05:00:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-07 05:00:35 +0000 |
commit | 28c34bd8eb97dcdced2eb84ff23d0595d9ef7291 (patch) | |
tree | 766b078323c932f54a813e5bf0debbba31fa0357 /llvm/lib/Analysis | |
parent | f9d29b32998337eabec2f6471e3be68b4626bc25 (diff) | |
download | bcm5719-llvm-28c34bd8eb97dcdced2eb84ff23d0595d9ef7291.tar.gz bcm5719-llvm-28c34bd8eb97dcdced2eb84ff23d0595d9ef7291.zip |
Fix problem with dangling referrers
llvm-svn: 4595
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/IPA/IPModRef.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/IPA/IPModRef.cpp b/llvm/lib/Analysis/IPA/IPModRef.cpp index 0f9da425317..6b7095bcabd 100644 --- a/llvm/lib/Analysis/IPA/IPModRef.cpp +++ b/llvm/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); |