Skip to content

Commit

Permalink
[BOLT][NFC] Simplify successor check (llvm#91980)
Browse files Browse the repository at this point in the history
Remove excess parentheses and use `boolean ? true-case : false-case` idiom.
  • Loading branch information
urnathan authored May 14, 2024
1 parent 312f83f commit 1aff294
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bolt/lib/Core/BinaryBasicBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@ bool BinaryBasicBlock::validateSuccessorInvariants() {
break;
}
case 2:
Valid = (CondBranch &&
(TBB == getConditionalSuccessor(true)->getLabel() &&
((!UncondBranch && !FBB) ||
(UncondBranch &&
FBB == getConditionalSuccessor(false)->getLabel()))));
Valid =
CondBranch && TBB == getConditionalSuccessor(true)->getLabel() &&
(UncondBranch ? FBB == getConditionalSuccessor(false)->getLabel()
: !FBB);
break;
}
}
Expand Down

0 comments on commit 1aff294

Please sign in to comment.