[llvm] 6e90192 - PatternMatch.h - wrap WrapFlags tests inside brackets to stop static analysis warning about & vs && usage. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 6 05:41:12 PDT 2021


Author: Simon Pilgrim
Date: 2021-06-06T13:38:39+01:00
New Revision: 6e90192fdfef17d48d26a0fba067410e36d9e636

URL: https://github.com/llvm/llvm-project/commit/6e90192fdfef17d48d26a0fba067410e36d9e636
DIFF: https://github.com/llvm/llvm-project/commit/6e90192fdfef17d48d26a0fba067410e36d9e636.diff

LOG: PatternMatch.h - wrap WrapFlags tests inside brackets to stop static analysis warning about & vs && usage. NFCI.

Added: 
    

Modified: 
    llvm/include/llvm/IR/PatternMatch.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h
index a67e666ca059c..8f99132522126 100644
--- a/llvm/include/llvm/IR/PatternMatch.h
+++ b/llvm/include/llvm/IR/PatternMatch.h
@@ -1168,10 +1168,10 @@ struct OverflowingBinaryOp_match {
     if (auto *Op = dyn_cast<OverflowingBinaryOperator>(V)) {
       if (Op->getOpcode() != Opcode)
         return false;
-      if (WrapFlags & OverflowingBinaryOperator::NoUnsignedWrap &&
+      if ((WrapFlags & OverflowingBinaryOperator::NoUnsignedWrap) &&
           !Op->hasNoUnsignedWrap())
         return false;
-      if (WrapFlags & OverflowingBinaryOperator::NoSignedWrap &&
+      if ((WrapFlags & OverflowingBinaryOperator::NoSignedWrap) &&
           !Op->hasNoSignedWrap())
         return false;
       return L.match(Op->getOperand(0)) && R.match(Op->getOperand(1));


        


More information about the llvm-commits mailing list