From: Duncan P. N. Exon Smith Date: Mon, 19 Jan 2015 23:15:21 +0000 (+0000) Subject: IR: Cleanup MDNode::MDNode(), NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=898c48822f6e498d9581afe58c1ffffa1c9f292e;p=llvm IR: Cleanup MDNode::MDNode(), NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226521 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp index 0310ee776c9..fb70149330b 100644 --- a/lib/IR/Metadata.cpp +++ b/lib/IR/Metadata.cpp @@ -403,20 +403,19 @@ MDNode::MDNode(LLVMContext &Context, unsigned ID, StorageType Storage, for (unsigned I = 0, E = MDs.size(); I != E; ++I) setOperand(I, MDs[I]); - if (isTemporary()) - this->Context.makeReplaceable( - make_unique(Context)); - - if (!isUniqued()) + if (isDistinct()) return; - // Check whether any operands are unresolved, requiring re-uniquing. - unsigned NumUnresolved = countUnresolvedOperands(); - if (!NumUnresolved) - return; + if (isUniqued()) { + // Check whether any operands are unresolved, requiring re-uniquing. + unsigned NumUnresolved = countUnresolvedOperands(); + if (!NumUnresolved) + return; + + SubclassData32 = NumUnresolved; + } this->Context.makeReplaceable(make_unique(Context)); - SubclassData32 = NumUnresolved; } static bool isOperandUnresolved(Metadata *Op) {