Gracefully destroy MDNodes.

llvm-svn: 81353
This commit is contained in:
Devang Patel 2009-09-09 17:07:07 +00:00
parent cfd0d3e363
commit a12b2d35a0

View File

@ -203,6 +203,9 @@ public:
AggZeroConstants.freeConstants(); AggZeroConstants.freeConstants();
NullPtrConstants.freeConstants(); NullPtrConstants.freeConstants();
UndefValueConstants.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(); for (IntMapTy::iterator I=IntConstants.begin(), E=IntConstants.end();
I != E; ++I) { I != E; ++I) {
if (I->second->use_empty()) if (I->second->use_empty())