From 164a4fbb5b99aadf060d9c96d74e5d60d369ee04 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 24 Jan 2013 00:14:46 +0000 Subject: Cleanup the AttributeSetNodes that we create. llvm-svn: 173311 --- llvm/lib/IR/LLVMContextImpl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm') diff --git a/llvm/lib/IR/LLVMContextImpl.cpp b/llvm/lib/IR/LLVMContextImpl.cpp index 8fc9379e5bf..89e163f5141 100644 --- a/llvm/lib/IR/LLVMContextImpl.cpp +++ b/llvm/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; -- cgit v1.2.3