From: Devang Patel Date: Thu, 11 Feb 2010 19:35:10 +0000 (+0000) Subject: Destroy MDNodes while destructing llvm context. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=11dbf8ee694ba02843814c42bc4dc278f6935dd5;p=oota-llvm.git Destroy MDNodes while destructing llvm context. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95903 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index f7f4860614a..4eb07224045 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -224,7 +224,10 @@ public: if (I->second->use_empty()) delete I->second; } - MDNodeSet.clear(); + while (!MDNodeSet.empty()) { + MDNode *N = &(*MDNodeSet.begin()); + N->destroy(); + } AlwaysOpaqueTy->dropRef(); for (OpaqueTypesTy::iterator I = OpaqueTypes.begin(), E = OpaqueTypes.end(); I != E; ++I) {