summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2010-03-30 11:17:48 +0000
committerTorok Edwin <edwintorok@gmail.com>2010-03-30 11:17:48 +0000
commit8061bb141e735ed41543d9ebd8f8e47bde70886a (patch)
tree01114ddf11ccb8dc20f5bae5bf1688b2ca231da9 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parenta2d1dc42e1ad19ccf028b837ae788fd832422871 (diff)
downloadbcm5719-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.cpp7
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();
OpenPOWER on IntegriCloud