summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-12 18:59:40 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-12 18:59:40 +0000
commit6c0aee3248a2c06ab4690e2ba7a50edd0e0bf8f4 (patch)
tree5ba25e8aa4768395867d4ce9de61631202454a11 /llvm/lib/IR
parentc0286874d79938894183176510fa0433817a29d8 (diff)
downloadbcm5719-llvm-6c0aee3248a2c06ab4690e2ba7a50edd0e0bf8f4.tar.gz
bcm5719-llvm-6c0aee3248a2c06ab4690e2ba7a50edd0e0bf8f4.zip
IR: Don't allow operands to become unresolved
Operands shouldn't change from being resolved to unresolved during graph construction. Simplify the logic based on that assumption. llvm-svn: 225649
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/Metadata.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 6cb6efe3d66..34ecf3dfc2d 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -547,12 +547,16 @@ void GenericMDNode::handleChangedOperand(void *Ref, Metadata *New) {
if (!isResolved()) {
// Check if the last unresolved operand has just been resolved; if so,
// resolve this as well.
- if (isOperandUnresolved(Old))
- decrementUnresolvedOperands();
- if (isOperandUnresolved(New))
- incrementUnresolvedOperands();
- if (!hasUnresolvedOperands())
- resolve();
+ if (isOperandUnresolved(Old)) {
+ if (!isOperandUnresolved(New)) {
+ decrementUnresolvedOperands();
+ if (!hasUnresolvedOperands())
+ resolve();
+ }
+ } else {
+ // Operands shouldn't become unresolved.
+ assert(isOperandUnresolved(New) && "Operand just became unresolved");
+ }
}
return;
OpenPOWER on IntegriCloud