[llvm-commits] [llvm] r95903 - /llvm/trunk/lib/VMCore/LLVMContextImpl.h

Devang Patel dpatel at apple.com
Thu Feb 11 11:35:11 PST 2010


Author: dpatel
Date: Thu Feb 11 13:35:10 2010
New Revision: 95903

URL: http://llvm.org/viewvc/llvm-project?rev=95903&view=rev
Log:
Destroy MDNodes while destructing llvm context.

Modified:
    llvm/trunk/lib/VMCore/LLVMContextImpl.h

Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContextImpl.h?rev=95903&r1=95902&r2=95903&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContextImpl.h (original)
+++ llvm/trunk/lib/VMCore/LLVMContextImpl.h Thu Feb 11 13:35:10 2010
@@ -224,7 +224,10 @@
       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) {





More information about the llvm-commits mailing list