[llvm-commits] [llvm] r41739 - in /llvm/trunk/lib/CodeGen: LiveInterval.cpp LiveIntervalAnalysis.cpp
Evan Cheng
evan.cheng at apple.com
Wed Sep 5 18:07:28 PDT 2007
Author: evancheng
Date: Wed Sep 5 20:07:24 2007
New Revision: 41739
URL: http://llvm.org/viewvc/llvm-project?rev=41739&view=rev
Log:
Fix a memory leak.
Modified:
llvm/trunk/lib/CodeGen/LiveInterval.cpp
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=41739&r1=41738&r2=41739&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveInterval.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveInterval.cpp Wed Sep 5 20:07:24 2007
@@ -476,7 +476,9 @@
// ~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;
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=41739&r1=41738&r2=41739&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Sep 5 20:07:24 2007
@@ -62,10 +62,11 @@
}
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];
}
More information about the llvm-commits
mailing list