diff options
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r-- | llvm/lib/IR/Metadata.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 39d76c51d0d..6ccb55d18b2 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -758,11 +758,7 @@ void MDNode::replaceOperandWith(unsigned I, Metadata *New) { void MDNode::setOperand(unsigned I, Metadata *New) { assert(I < NumOperands); - if (isStoredDistinctInContext() || isa<MDNodeFwdDecl>(this)) - // No need for a callback, this isn't uniqued. - mutable_begin()[I].reset(New, nullptr); - else - mutable_begin()[I].reset(New, this); + mutable_begin()[I].reset(New, isUniqued() ? this : nullptr); } /// \brief Get a node, or a self-reference that looks like it. |