aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/TopDownClosure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-30 04:53:08 +0000
committerChris Lattner <sabre@nondot.org>2003-06-30 04:53:08 +0000
commit3d162907e3f52560cdd75e4bedf5d37795b8d79c (patch)
tree1cf2642a65b69c14c7426a95f653b02e573e8afb /lib/Analysis/DataStructure/TopDownClosure.cpp
parent8d32767da44c6b06033fe305f3fd8e73ba042b4a (diff)
Do not multiply delete graphs if functions are sharing graphs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6997 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/TopDownClosure.cpp')
-rw-r--r--lib/Analysis/DataStructure/TopDownClosure.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp
index 85a79d1076..7eea922661 100644
--- a/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/lib/Analysis/DataStructure/TopDownClosure.cpp
@@ -45,10 +45,12 @@ bool TDDataStructures::run(Module &M) {
// has no way to extend the lifetime of the pass, which screws up ds-aa.
//
void TDDataStructures::releaseMyMemory() {
- return;
- for (hash_map<const Function*, DSGraph*>::iterator I = DSInfo.begin(),
- E = DSInfo.end(); I != E; ++I)
- delete I->second;
+ for (hash_map<Function*, DSGraph*>::iterator I = DSInfo.begin(),
+ E = DSInfo.end(); I != E; ++I) {
+ I->second->getReturnNodes().erase(I->first);
+ if (I->second->getReturnNodes().empty())
+ delete I->second;
+ }
// Empty map so next time memory is released, data structures are not
// re-deleted.