mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:50:30 +00:00
Fix a memory leak.
llvm-svn: 41739
This commit is contained in:
parent
896c1ed385
commit
15c07fb194
@ -476,7 +476,9 @@ void LiveInterval::MergeValueNumberInto(VNInfo *V1, VNInfo *V2) {
|
||||
// ~1U so it can be nuked later.
|
||||
if (V1->id == getNumValNums()-1) {
|
||||
do {
|
||||
VNInfo *VNI = valnos.back();
|
||||
valnos.pop_back();
|
||||
VNI->~VNInfo();
|
||||
} while (valnos.back()->def == ~1U);
|
||||
} else {
|
||||
V1->def = ~1U;
|
||||
|
@ -62,10 +62,11 @@ void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
}
|
||||
|
||||
void LiveIntervals::releaseMemory() {
|
||||
VNInfoAllocator.Reset();
|
||||
mi2iMap_.clear();
|
||||
i2miMap_.clear();
|
||||
r2iMap_.clear();
|
||||
// Release VNInfo memroy regions after all VNInfo objects are dtor'd.
|
||||
VNInfoAllocator.Reset();
|
||||
for (unsigned i = 0, e = ClonedMIs.size(); i != e; ++i)
|
||||
delete ClonedMIs[i];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user