From: Bill Wendling Date: Thu, 24 Jan 2013 00:14:46 +0000 (+0000) Subject: Cleanup the AttributeSetNodes that we create. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8b1f2f3b7007e1e086c0e20ad4fdea72222c4baf;p=oota-llvm.git Cleanup the AttributeSetNodes that we create. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173311 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/LLVMContextImpl.cpp b/lib/IR/LLVMContextImpl.cpp index 8fc9379e5bf..89e163f5141 100644 --- a/lib/IR/LLVMContextImpl.cpp +++ b/lib/IR/LLVMContextImpl.cpp @@ -109,6 +109,13 @@ LLVMContextImpl::~LLVMContextImpl() { delete &*Elem; } + // Destroy attribute node lists. + for (FoldingSetIterator I = AttrsSetNodes.begin(), + E = AttrsSetNodes.end(); I != E; ) { + FoldingSetIterator 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 MDNodes;