From e85df9e0a2572a8f8a268ffe9925c41b063a1dc3 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 19 Jan 2015 19:29:25 +0000 Subject: [PATCH] IR: Simplify MDNode::setOperand(), NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226492 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Metadata.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp index 39d76c51d0d..6ccb55d18b2 100644 --- a/lib/IR/Metadata.cpp +++ b/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(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.