From efdf285bbe0c2911c882fe83983b194e0c419470 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 llvm-svn: 226492 --- llvm/lib/IR/Metadata.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 39d76c5..6ccb55d 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(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. -- 2.7.4