Skip to content

Commit 43fe9af

Browse files
committed
MatchTableRecord::emit - fix boolean operator precedence warnings from PVS Studio. NFCI.
Make it clear that (Flags & MTRF_????) should resolve to a boolean.
1 parent 77a6b35 commit 43fe9af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/TableGen/GlobalISelEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ MatchTableRecord MatchTable::LineBreak = {
609609
void MatchTableRecord::emit(raw_ostream &OS, bool LineBreakIsNextAfterThis,
610610
const MatchTable &Table) const {
611611
bool UseLineComment =
612-
LineBreakIsNextAfterThis | (Flags & MTRF_LineBreakFollows);
612+
LineBreakIsNextAfterThis || (Flags & MTRF_LineBreakFollows);
613613
if (Flags & (MTRF_JumpTarget | MTRF_CommaFollows))
614614
UseLineComment = false;
615615

@@ -620,7 +620,7 @@ void MatchTableRecord::emit(raw_ostream &OS, bool LineBreakIsNextAfterThis,
620620
if (Flags & MTRF_Label)
621621
OS << ": @" << Table.getLabelIndex(LabelID);
622622

623-
if (Flags & MTRF_Comment && !UseLineComment)
623+
if ((Flags & MTRF_Comment) && !UseLineComment)
624624
OS << "*/";
625625

626626
if (Flags & MTRF_JumpTarget) {

0 commit comments

Comments
 (0)