IR: Cleanup MDNode::MDNode(), NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226521 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-01-19 23:15:21 +00:00
parent b0617860b5
commit 898c48822f

View File

@ -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<ReplaceableMetadataImpl>(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<ReplaceableMetadataImpl>(Context));
SubclassData32 = NumUnresolved;
}
static bool isOperandUnresolved(Metadata *Op) {