summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-12 19:45:44 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-12 19:45:44 +0000
commit0c87d7717525af8269ce0d93568600a423412ba6 (patch)
treea3c7895d169687acc018f3a6996f3ef6ea2f2240 /llvm/lib/IR/Metadata.cpp
parent34c3d10363c90a4b113cb86c6661595056a16378 (diff)
downloadbcm5719-llvm-0c87d7717525af8269ce0d93568600a423412ba6.tar.gz
bcm5719-llvm-0c87d7717525af8269ce0d93568600a423412ba6.zip
IR: Invert logic to simplify control flow, NFC
llvm-svn: 225670
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r--llvm/lib/IR/Metadata.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index f78e7d2534d..859512db001 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -451,19 +451,16 @@ void GenericMDNode::resolve() {
void GenericMDNode::resolveAfterOperandChange(Metadata *Old, Metadata *New) {
assert(SubclassData32 != 0 && "Expected unresolved operands");
- // Check if the last unresolved operand has just been resolved; if so,
- // resolve this as well.
- if (isOperandUnresolved(Old)) {
- if (!isOperandUnresolved(New))
- decrementUnresolvedOperandCount();
- } else {
- // Operands shouldn't become unresolved.
+ // Check if an operand was resolved.
+ if (!isOperandUnresolved(Old))
assert(isOperandUnresolved(New) && "Operand just became unresolved");
- }
+ else if (!isOperandUnresolved(New))
+ decrementUnresolvedOperandCount();
}
void GenericMDNode::decrementUnresolvedOperandCount() {
if (!--SubclassData32)
+ // Last unresolved operand has just been resolved.
resolve();
}
OpenPOWER on IntegriCloud