Cleanup the AttributeSetNodes that we create.
authorBill Wendling <isanbard@gmail.com>
Thu, 24 Jan 2013 00:14:46 +0000 (00:14 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 24 Jan 2013 00:14:46 +0000 (00:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173311 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/LLVMContextImpl.cpp

index 8fc9379e5bf9c58ac83572c7bc93c43675118be2..89e163f5141256e8ba79d8e3f9b0e4e23aa74488 100644 (file)
@@ -109,6 +109,13 @@ LLVMContextImpl::~LLVMContextImpl() {
     delete &*Elem;
   }
 
+  // Destroy attribute node lists.
+  for (FoldingSetIterator<AttributeSetNode> I = AttrsSetNodes.begin(),
+         E = AttrsSetNodes.end(); I != E; ) {
+    FoldingSetIterator<AttributeSetNode> Elem = I++;
+    delete &*Elem;
+  }
+
   // Destroy MDNodes.  ~MDNode can move and remove nodes between the MDNodeSet
   // and the NonUniquedMDNodes sets, so copy the values out first.
   SmallVector<MDNode*, 8> MDNodes;