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
This commit is contained in:
Duncan P. N. Exon Smith 2015-01-12 18:59:40 +00:00
parent c0286874d7
commit 6c0aee3248
1 changed files with 10 additions and 6 deletions

View File

@ -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;