From 9a9c07d71166576dfbac1fbf8b8568305c77400c Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 2 Nov 2019 21:28:37 +0000 Subject: [PATCH] isConditionalBranch/isUnconditionalBranch - use boolean operators. NFCI. Stop static analyzer warnings about using bitwise operators on booleans. --- llvm/include/llvm/CodeGen/MachineInstr.h | 4 ++-- llvm/include/llvm/MC/MCInstrDesc.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h index 76d75e8064f8..55457aaa7830 100644 --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -718,7 +718,7 @@ public: /// block. The TargetInstrInfo::AnalyzeBranch method can be used to get more /// information about this branch. bool isConditionalBranch(QueryType Type = AnyInBundle) const { - return isBranch(Type) & !isBarrier(Type) & !isIndirectBranch(Type); + return isBranch(Type) && !isBarrier(Type) && !isIndirectBranch(Type); } /// Return true if this is a branch which always @@ -726,7 +726,7 @@ public: /// TargetInstrInfo::AnalyzeBranch method can be used to get more information /// about this branch. bool isUnconditionalBranch(QueryType Type = AnyInBundle) const { - return isBranch(Type) & isBarrier(Type) & !isIndirectBranch(Type); + return isBranch(Type) && isBarrier(Type) && !isIndirectBranch(Type); } /// Return true if this instruction has a predicate operand that diff --git a/llvm/include/llvm/MC/MCInstrDesc.h b/llvm/include/llvm/MC/MCInstrDesc.h index e75a27614a22..8791ba3ba425 100644 --- a/llvm/include/llvm/MC/MCInstrDesc.h +++ b/llvm/include/llvm/MC/MCInstrDesc.h @@ -304,7 +304,7 @@ public: /// block. The TargetInstrInfo::AnalyzeBranch method can be used to get more /// information about this branch. bool isConditionalBranch() const { - return isBranch() & !isBarrier() & !isIndirectBranch(); + return isBranch() && !isBarrier() && !isIndirectBranch(); } /// Return true if this is a branch which always @@ -312,7 +312,7 @@ public: /// TargetInstrInfo::AnalyzeBranch method can be used to get more information /// about this branch. bool isUnconditionalBranch() const { - return isBranch() & isBarrier() & !isIndirectBranch(); + return isBranch() && isBarrier() && !isIndirectBranch(); } /// Return true if this is a branch or an instruction which directly