summaryrefslogtreecommitdiff
path: root/lib/VMCore/Metadata.cpp
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-03-07 19:26:40 +0000
committerJeffrey Yasskin <jyasskin@google.com>2010-03-07 19:26:40 +0000
commit6fec233a1e4b26be2f69e02884d4f3c2a2c4a437 (patch)
treee1e17d4e2c832b4360005c4b2a9b9f7e9232ae12 /lib/VMCore/Metadata.cpp
parent92ce42f9fc8758ff83da3ebf7cd0a60bdaec3c58 (diff)
downloadllvm-6fec233a1e4b26be2f69e02884d4f3c2a2c4a437.tar.gz
llvm-6fec233a1e4b26be2f69e02884d4f3c2a2c4a437.tar.bz2
llvm-6fec233a1e4b26be2f69e02884d4f3c2a2c4a437.tar.xz
Roll back r97918 again. Just configuring against llvm-gcc wasn't enough to run
the FrontendC* tests. :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Metadata.cpp')
-rw-r--r--lib/VMCore/Metadata.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp
index faf83e6588..a08c45480b 100644
--- a/lib/VMCore/Metadata.cpp
+++ b/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.