mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Do not delete the same graph multiple times when freeing memory if graphs are sharing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6998 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3d162907e3
commit
81d924d804
@ -487,9 +487,12 @@ bool LocalDataStructures::run(Module &M) {
|
||||
// our memory... here...
|
||||
//
|
||||
void LocalDataStructures::releaseMemory() {
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user