mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user