[llvm] 9a9c07d - isConditionalBranch/isUnconditionalBranch - use boolean operators. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 2 14:39:04 PDT 2019


Author: Simon Pilgrim
Date: 2019-11-02T21:38:46Z
New Revision: 9a9c07d71166576dfbac1fbf8b8568305c77400c

URL: https://github.com/llvm/llvm-project/commit/9a9c07d71166576dfbac1fbf8b8568305c77400c
DIFF: https://github.com/llvm/llvm-project/commit/9a9c07d71166576dfbac1fbf8b8568305c77400c.diff

LOG: isConditionalBranch/isUnconditionalBranch - use boolean operators. NFCI.

Stop static analyzer warnings about using bitwise operators on booleans.

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/MachineInstr.h
    llvm/include/llvm/MC/MCInstrDesc.h

Removed: 
    


################################################################################
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 @@ class MachineInstr
   /// 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 @@ class MachineInstr
   /// 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 @@ class MCInstrDesc {
   /// 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 @@ class MCInstrDesc {
   /// 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


        


More information about the llvm-commits mailing list