From 94e5001925e25df698a8372024f06bd8581e6edf Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 9 Sep 2009 17:07:07 +0000 Subject: Gracefully destroy MDNodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81353 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/LLVMContextImpl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/VMCore/LLVMContextImpl.h') diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index 77130d1..048018d 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -203,6 +203,9 @@ public: AggZeroConstants.freeConstants(); NullPtrConstants.freeConstants(); UndefValueConstants.freeConstants(); + for (FoldingSet::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()) -- cgit v1.1