aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-08-17 19:33:52 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-08-17 19:33:52 +0000
commita7fe922b98bb45be7dce7c1cfe668ec27eeddc74 (patch)
treee9648f5bddc775b842e53141d7c9748482f7115a /lib/IR/Metadata.cpp
parentc3aee98e721333f265a88d6bf348e6e468f027d4 (diff)
Notes
Diffstat (limited to 'lib/IR/Metadata.cpp')
-rw-r--r--lib/IR/Metadata.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp
index 5201c2ecce6a..f35c64b27b5b 100644
--- a/lib/IR/Metadata.cpp
+++ b/lib/IR/Metadata.cpp
@@ -675,8 +675,8 @@ void MDNode::handleChangedOperand(void *Ref, Metadata *New) {
Metadata *Old = getOperand(Op);
setOperand(Op, New);
- // Drop uniquing for self-reference cycles.
- if (New == this) {
+ // Drop uniquing for self-reference cycles and deleted constants.
+ if (New == this || (!New && Old && isa<ConstantAsMetadata>(Old))) {
if (!isResolved())
resolve();
storeDistinctInContext();