CodeGen: Let the BumpPtrAllocator free the elements of indexList
[oota-llvm.git] / include / llvm / CodeGen / SlotIndexes.h
index 5dc42e20debe344d0b9292e919af80f7531b432f..7b621bee259ffe3f9110787bece4e2b35be64617 100644 (file)
@@ -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;