[llvm-commits] [llvm] r111713 - /llvm/trunk/lib/VMCore/Metadata.cpp
Dan Gohman
gohman at apple.com
Fri Aug 20 19:52:29 PDT 2010
Author: djg
Date: Fri Aug 20 21:52:29 2010
New Revision: 111713
URL: http://llvm.org/viewvc/llvm-project?rev=111713&view=rev
Log:
Add an assert to MDNode::deleteTemporary check that the node being deleted
is not non-temporary.
Modified:
llvm/trunk/lib/VMCore/Metadata.cpp
Modified: llvm/trunk/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=111713&r1=111712&r2=111713&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Fri Aug 20 21:52:29 2010
@@ -257,10 +257,12 @@
void MDNode::deleteTemporary(MDNode *N) {
assert(N->use_empty() && "Temporary MDNode has uses!");
+ assert(!N->getContext().pImpl->MDNodeSet.RemoveNode(N) &&
+ "Deleting a non-temporary node!");
assert((N->getSubclassDataFromValue() & NotUniquedBit) &&
"Temporary MDNode does not have NotUniquedBit set!");
assert((N->getSubclassDataFromValue() & DestroyFlag) == 0 &&
- "Temporary MDNode does has DestroyFlag set!");
+ "Temporary MDNode has DestroyFlag set!");
N->setValueSubclassData(N->getSubclassDataFromValue() |
DestroyFlag);
LeakDetector::removeGarbageObject(N);
More information about the llvm-commits
mailing list