From: Justin Bogner Date: Sat, 5 Dec 2015 00:39:14 +0000 (+0000) Subject: CodeGen: Let the BumpPtrAllocator free the elements of indexList X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=83eafdfffcd7fc709e4738213c3355d9b2d933b9;p=oota-llvm.git CodeGen: Let the BumpPtrAllocator free the elements of indexList The indexList's nodes are all allocated on a BumpPtrAllocator, so it's more efficient to let them be freed when it goes away, rather than deleting them directly. This is a follow up to r254794. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254808 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h index 5dc42e20deb..7b621bee259 100644 --- a/include/llvm/CodeGen/SlotIndexes.h +++ b/include/llvm/CodeGen/SlotIndexes.h @@ -376,6 +376,11 @@ namespace llvm { initializeSlotIndexesPass(*PassRegistry::getPassRegistry()); } + ~SlotIndexes() { + // The indexList's nodes are all allocated in the BumpPtrAllocator. + indexList.clearAndLeakNodesUnsafely(); + } + void getAnalysisUsage(AnalysisUsage &au) const override; void releaseMemory() override;