summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-13 00:46:34 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-13 00:46:34 +0000
commit845755c4bb6c55eca84700060de706331ba77a71 (patch)
treeed0ff70b5d88fb80d53b49502ee77d5f96193ffd /llvm/lib/IR/Metadata.cpp
parenta982e4f82bd369ead2194db441cb5892fd54d218 (diff)
downloadbcm5719-llvm-845755c4bb6c55eca84700060de706331ba77a71.tar.gz
bcm5719-llvm-845755c4bb6c55eca84700060de706331ba77a71.zip
IR: Remove an invalid assertion when replacing resolved operands
This adds back the testcase from r225738, and adds to it. Looks like we need both sides for now (the assertion was incorrect both ways, and although it seemed reasonable (when written correctly) it wasn't particularly important). llvm-svn: 225745
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r--llvm/lib/IR/Metadata.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 13844313925..852f1dc2041 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -443,9 +443,11 @@ void UniquableMDNode::resolveAfterOperandChange(Metadata *Old, Metadata *New) {
assert(SubclassData32 != 0 && "Expected unresolved operands");
// Check if an operand was resolved.
- if (!isOperandUnresolved(Old))
- assert(isOperandUnresolved(New) && "Operand just became unresolved");
- else if (!isOperandUnresolved(New))
+ if (!isOperandUnresolved(Old)) {
+ if (isOperandUnresolved(New))
+ // An operand was un-resolved!
+ ++SubclassData32;
+ } else if (!isOperandUnresolved(New))
decrementUnresolvedOperandCount();
}
OpenPOWER on IntegriCloud