summaryrefslogtreecommitdiff
path: root/lib/VMCore/LLVMContextImpl.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-09-09 17:07:07 +0000
committerDevang Patel <dpatel@apple.com>2009-09-09 17:07:07 +0000
commit9c0aa853377eaa36c0521b5cb29e52fbb7a0dda0 (patch)
treeb4b603ba0b1ea01a301aa7851b2d0965aab6213f /lib/VMCore/LLVMContextImpl.h
parente2ad47e415357f3c2bd01583cb0263642d3e6de8 (diff)
downloadllvm-9c0aa853377eaa36c0521b5cb29e52fbb7a0dda0.tar.gz
llvm-9c0aa853377eaa36c0521b5cb29e52fbb7a0dda0.tar.bz2
llvm-9c0aa853377eaa36c0521b5cb29e52fbb7a0dda0.tar.xz
Gracefully destroy MDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/LLVMContextImpl.h')
-rw-r--r--lib/VMCore/LLVMContextImpl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h
index 77130d1ab9..048018d6b4 100644
--- a/lib/VMCore/LLVMContextImpl.h
+++ b/lib/VMCore/LLVMContextImpl.h
@@ -203,6 +203,9 @@ public:
AggZeroConstants.freeConstants();
NullPtrConstants.freeConstants();
UndefValueConstants.freeConstants();
+ for (FoldingSet<MDNode>::iterator I=MDNodeSet.begin(),
+ E =MDNodeSet.end(); I != E; ++I)
+ I->dropAllReferences();
for (IntMapTy::iterator I=IntConstants.begin(), E=IntConstants.end();
I != E; ++I) {
if (I->second->use_empty())