Cleanup the AttributeSetNodes that we create.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173311 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2013-01-24 00:14:46 +00:00
parent 3467e30edf
commit 8b1f2f3b70

View File

@ -109,6 +109,13 @@ LLVMContextImpl::~LLVMContextImpl() {
delete &*Elem; 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 // Destroy MDNodes. ~MDNode can move and remove nodes between the MDNodeSet
// and the NonUniquedMDNodes sets, so copy the values out first. // and the NonUniquedMDNodes sets, so copy the values out first.
SmallVector<MDNode*, 8> MDNodes; SmallVector<MDNode*, 8> MDNodes;