summaryrefslogtreecommitdiffstats
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
commit93056ec4e253206a4716dfba8547f38f4e6bbb70 (patch)
treef4d126fc0b0c08d844823dfe74e312014804fadd
parent97840a396bcc77ed2f9c83328a7ee7111699a841 (diff)
downloadbcm5719-llvm-93056ec4e253206a4716dfba8547f38f4e6bbb70.tar.gz
bcm5719-llvm-93056ec4e253206a4716dfba8547f38f4e6bbb70.zip
Gracefully destroy MDNodes.
llvm-svn: 81353
-rw-r--r--llvm/lib/VMCore/LLVMContextImpl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/LLVMContextImpl.h b/llvm/lib/VMCore/LLVMContextImpl.h
index 77130d1ab94..048018d6b4d 100644
--- a/llvm/lib/VMCore/LLVMContextImpl.h
+++ b/llvm/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())
OpenPOWER on IntegriCloud