diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2010-03-05 06:43:49 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2010-03-05 06:43:49 +0000 |
commit | 5c92f933b33ee7e3a5f1a9e944bfd84a6aa935dc (patch) | |
tree | 788a51eeb7a30c7e153cf6fa6674756af7e7af68 /llvm/lib/VMCore/Metadata.cpp | |
parent | 55e81eb49fb3779ea658d05d5c84e08da3f42136 (diff) | |
download | bcm5719-llvm-5c92f933b33ee7e3a5f1a9e944bfd84a6aa935dc.tar.gz bcm5719-llvm-5c92f933b33ee7e3a5f1a9e944bfd84a6aa935dc.zip |
Revert r97788 because it broke test/FrontendC/2010-02-16-DbgVarScope.c.
llvm-svn: 97792
Diffstat (limited to 'llvm/lib/VMCore/Metadata.cpp')
-rw-r--r-- | llvm/lib/VMCore/Metadata.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/VMCore/Metadata.cpp b/llvm/lib/VMCore/Metadata.cpp index faf83e6588e..a08c45480b6 100644 --- a/llvm/lib/VMCore/Metadata.cpp +++ b/llvm/lib/VMCore/Metadata.cpp @@ -110,10 +110,8 @@ MDNode::MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals, MDNode::~MDNode() { assert((getSubclassDataFromValue() & DestroyFlag) != 0 && "Not being destroyed through destroy()?"); - LLVMContextImpl *pImpl = getType()->getContext().pImpl; - if (isNotUniqued()) { - pImpl->NonUniquedMDNodes.erase(this); - } else { + if (!isNotUniqued()) { + LLVMContextImpl *pImpl = getType()->getContext().pImpl; pImpl->MDNodeSet.RemoveNode(this); } @@ -259,10 +257,12 @@ void MDNode::Profile(FoldingSetNodeID &ID) const { ID.AddPointer(getOperand(i)); } -void MDNode::setIsNotUniqued() { - setValueSubclassData(getSubclassDataFromValue() | NotUniquedBit); - LLVMContextImpl *pImpl = getType()->getContext().pImpl; - pImpl->NonUniquedMDNodes.insert(this); +// replaceAllOperandsWithNull - This is used while destroying llvm context to +// gracefully delete all nodes. This method replaces all operands with null. +void MDNode::replaceAllOperandsWithNull() { + for (MDNodeOperand *Op = getOperandPtr(this, 0), *E = Op+NumOperands; + Op != E; ++Op) + replaceOperand(Op, 0); } // Replace value from this node's operand list. |