aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
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();