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 | 8061bb141e735ed41543d9ebd8f8e47bde70886a (patch) | |
tree | 01114ddf11ccb8dc20f5bae5bf1688b2ca231da9 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | a2d1dc42e1ad19ccf028b837ae788fd832422871 (diff) | |
download | bcm5719-llvm-8061bb141e735ed41543d9ebd8f8e47bde70886a.tar.gz bcm5719-llvm-8061bb141e735ed41543d9ebd8f8e47bde70886a.zip |
Reapply r99881 with some fixes: only call destructor in releaseMemory!
llvm-svn: 99883
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index e657c46c721..53366b9f074 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/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(); |