summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-19 23:15:21 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-19 23:15:21 +0000
commita1ae4f6b30205cf49f2109bac0b6c787d8a8767b (patch)
treebadadccfea4a71c070525d06b118c7e10074571f /llvm/lib/IR/Metadata.cpp
parent2bc00f4a383549386c471db17cacb08cc9e53a0d (diff)
downloadbcm5719-llvm-a1ae4f6b30205cf49f2109bac0b6c787d8a8767b.tar.gz
bcm5719-llvm-a1ae4f6b30205cf49f2109bac0b6c787d8a8767b.zip
IR: Cleanup MDNode::MDNode(), NFC
llvm-svn: 226521
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r--llvm/lib/IR/Metadata.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 0310ee776c9..fb70149330b 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/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<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) {
OpenPOWER on IntegriCloud