summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-19 19:29:25 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-19 19:29:25 +0000
commitefdf285bbe0c2911c882fe83983b194e0c419470 (patch)
tree37ae87c33036ed67537e4543251f38907f9ba754 /llvm/lib/IR/Metadata.cpp
parent3d5805685b198eb2b20d5d085ea75f5e03ba7cfd (diff)
downloadbcm5719-llvm-efdf285bbe0c2911c882fe83983b194e0c419470.tar.gz
bcm5719-llvm-efdf285bbe0c2911c882fe83983b194e0c419470.zip
IR: Simplify MDNode::setOperand(), NFC
llvm-svn: 226492
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r--llvm/lib/IR/Metadata.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 39d76c51d0d..6ccb55d18b2 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<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.
OpenPOWER on IntegriCloud