summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-05 23:31:54 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-05 23:31:54 +0000
commitbcd960a1bcecee6d769b98020c06ff1f1e16fdaf (patch)
treea4fb300c4d110634a706fba7c36e10b60e83c535 /llvm/lib
parent6e6428d981703a664599071efd5c43f024b70842 (diff)
downloadbcm5719-llvm-bcd960a1bcecee6d769b98020c06ff1f1e16fdaf.tar.gz
bcm5719-llvm-bcd960a1bcecee6d769b98020c06ff1f1e16fdaf.zip
IR: Don't drop MDNode uniquing on null operands
Now that `LLVMContextImpl` can call `MDNode::dropAllReferences()` to prevent teardown madness, stop dropping uniquing just because an operand drops to null. Part of PR21532. llvm-svn: 225223
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/Metadata.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index bed2b6bd422..1a651573733 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -515,13 +515,8 @@ void GenericMDNode::handleChangedOperand(void *Ref, Metadata *New) {
Metadata *Old = getOperand(Op);
setOperand(Op, New);
- // Drop uniquing for self-reference cycles or if an operand drops to null.
- //
- // FIXME: Stop dropping uniquing when an operand drops to null. The original
- // motivation was to prevent madness during teardown of LLVMContextImpl, but
- // dropAllReferences() fixes that problem in a better way. (It's just here
- // now for better staging of semantic changes.)
- if (New == this || !New) {
+ // Drop uniquing for self-reference cycles.
+ if (New == this) {
storeDistinctInContext();
setHash(0);
if (!isResolved())
OpenPOWER on IntegriCloud