summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1478aab)
raw | patch | inline | side by side (parent: 1478aab)
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | |
Mon, 12 Jan 2015 18:59:40 +0000 (18:59 +0000) | ||
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | |
Mon, 12 Jan 2015 18:59:40 +0000 (18:59 +0000) |
Operands shouldn't change from being resolved to unresolved during graph
construction. Simplify the logic based on that assumption.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225649 91177308-0d34-0410-b5e6-96231b3b80d8
construction. Simplify the logic based on that assumption.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225649 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Metadata.cpp | patch | blob | history |
diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp
index 6cb6efe3d662a4de073228a576e323bcbdf89e02..34ecf3dfc2d6204224484cbe20cce57d9c614d0e 100644 (file)
--- a/lib/IR/Metadata.cpp
+++ b/lib/IR/Metadata.cpp
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;