From eada3a8b970344e3afb20573464b56f8c92016f7 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 10 Jul 2015 22:23:57 +0000 Subject: [PATCH] ARM: Use SpecificBumpPtrAllocator to fix leak introduced in r241920 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241951 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index c64c190ed15..f77af983791 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -116,7 +116,7 @@ namespace { /// Whether the instructions can be merged into a ldrd/strd instruction. bool CanMergeToLSDouble; }; - BumpPtrAllocator Allocator; + SpecificBumpPtrAllocator Allocator; SmallVector Candidates; SmallVector MergeBaseCandidates; @@ -996,7 +996,7 @@ void ARMLoadStoreOpt::FormCandidates(const MemOpQueue &MemOps) { } // Form a candidate from the Ops collected so far. - MergeCandidate *Candidate = new(Allocator) MergeCandidate; + MergeCandidate *Candidate = new(Allocator.Allocate()) MergeCandidate; for (unsigned C = SIndex, CE = SIndex + Count; C < CE; ++C) Candidate->Instrs.push_back(MemOps[C].MI); Candidate->LatestMIIdx = Latest - SIndex; @@ -1849,7 +1849,7 @@ bool ARMLoadStoreOpt::runOnMachineFunction(MachineFunction &Fn) { Modified |= MergeReturnIntoLDM(MBB); } - Allocator.Reset(); + Allocator.DestroyAll(); return Modified; } -- 2.34.1