mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-29 13:37:15 +00:00
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
This commit is contained in:
parent
8d32767da4
commit
3d162907e3
@ -45,10 +45,12 @@ bool TDDataStructures::run(Module &M) {
|
|||||||
// has no way to extend the lifetime of the pass, which screws up ds-aa.
|
// has no way to extend the lifetime of the pass, which screws up ds-aa.
|
||||||
//
|
//
|
||||||
void TDDataStructures::releaseMyMemory() {
|
void TDDataStructures::releaseMyMemory() {
|
||||||
return;
|
for (hash_map<Function*, DSGraph*>::iterator I = DSInfo.begin(),
|
||||||
for (hash_map<const Function*, DSGraph*>::iterator I = DSInfo.begin(),
|
E = DSInfo.end(); I != E; ++I) {
|
||||||
E = DSInfo.end(); I != E; ++I)
|
I->second->getReturnNodes().erase(I->first);
|
||||||
delete I->second;
|
if (I->second->getReturnNodes().empty())
|
||||||
|
delete I->second;
|
||||||
|
}
|
||||||
|
|
||||||
// Empty map so next time memory is released, data structures are not
|
// Empty map so next time memory is released, data structures are not
|
||||||
// re-deleted.
|
// re-deleted.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user