diff options
author | Torok Edwin <edwintorok@gmail.com> | 2010-03-30 11:17:48 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2010-03-30 11:17:48 +0000 |
commit | 01cb1b665da03e2b74c0724f71751e912ec8c2be (patch) | |
tree | b3b4b991b3f6b97a7d9e8070dc6312dcd60fccce /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 226dd2ba992b1f00491c10c59ca1889825bf92b6 (diff) |
Reapply r99881 with some fixes: only call destructor in releaseMemory!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index e657c46c72..53366b9f07 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -82,6 +82,11 @@ void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const { MachineFunctionPass::getAnalysisUsage(AU); } +static void VNInfoDTor(void* Ptr) +{ + reinterpret_cast<VNInfo*>(Ptr)->~VNInfo(); +} + void LiveIntervals::releaseMemory() { // Free the live intervals themselves. for (DenseMap<unsigned, LiveInterval*>::iterator I = r2iMap_.begin(), @@ -91,7 +96,7 @@ void LiveIntervals::releaseMemory() { r2iMap_.clear(); // Release VNInfo memroy regions after all VNInfo objects are dtor'd. - VNInfoAllocator.Reset(); + VNInfoAllocator.Reset((unsigned)sizeof(VNInfo), alignof<VNInfo>(), VNInfoDTor); while (!CloneMIs.empty()) { MachineInstr *MI = CloneMIs.back(); CloneMIs.pop_back(); |