summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit7695128217af9a06c792d98d2e329a92f4ada47f (patch)
tree53432ea0b14f5ebf271b8ddc93b31ccba0abe12e /llvm/lib
parent6d187fdc5a67a83a2e95245394afa77821fa9cd2 (diff)
downloadbcm5719-llvm-7695128217af9a06c792d98d2e329a92f4ada47f.tar.gz
bcm5719-llvm-7695128217af9a06c792d98d2e329a92f4ada47f.zip
Do not multiply delete graphs if functions are sharing graphs
llvm-svn: 6997
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/DataStructure/TopDownClosure.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
index 85a79d1076a..7eea9226612 100644
--- a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud