Add an assert to MDNode::deleteTemporary check that the node being deleted

is not non-temporary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111713 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-08-21 02:52:29 +00:00
parent 8bef744518
commit 990bdd50d1

View File

@ -257,10 +257,12 @@ MDNode *MDNode::getTemporary(LLVMContext &Context, Value *const *Vals,
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);