IR: Simplify MDNode::setOperand(), NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-01-19 19:29:25 +00:00
parent e2644b68c1
commit e85df9e0a2

View File

@ -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.