diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-02 21:01:45 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-02 21:04:07 +0000 |
| commit | 43fe9afa4fe4474d691ff84ea893bc671e8254c2 (patch) | |
| tree | 7a063d52c005546741ebae60b19bf80b54e7e413 | |
| parent | 77a6b358b51f363d0f1626579720e654ca5aae9a (diff) | |
| download | llvm-43fe9afa4fe4474d691ff84ea893bc671e8254c2.zip llvm-43fe9afa4fe4474d691ff84ea893bc671e8254c2.tar.gz llvm-43fe9afa4fe4474d691ff84ea893bc671e8254c2.tar.bz2 | |
MatchTableRecord::emit - fix boolean operator precedence warnings from PVS Studio. NFCI.
Make it clear that (Flags & MTRF_????) should resolve to a boolean.
| -rw-r--r-- | llvm/utils/TableGen/GlobalISelEmitter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp index ab4a91c..fdac5ba 100644 --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -609,7 +609,7 @@ MatchTableRecord MatchTable::LineBreak = { void MatchTableRecord::emit(raw_ostream &OS, bool LineBreakIsNextAfterThis, const MatchTable &Table) const { bool UseLineComment = - LineBreakIsNextAfterThis | (Flags & MTRF_LineBreakFollows); + LineBreakIsNextAfterThis || (Flags & MTRF_LineBreakFollows); if (Flags & (MTRF_JumpTarget | MTRF_CommaFollows)) UseLineComment = false; @@ -620,7 +620,7 @@ void MatchTableRecord::emit(raw_ostream &OS, bool LineBreakIsNextAfterThis, if (Flags & MTRF_Label) OS << ": @" << Table.getLabelIndex(LabelID); - if (Flags & MTRF_Comment && !UseLineComment) + if ((Flags & MTRF_Comment) && !UseLineComment) OS << "*/"; if (Flags & MTRF_JumpTarget) { |
