OSDN Git Service

[AsmWriter] Eliminate warning. NFC
authorSerguei Katkov <serguei.katkov@azul.com>
Fri, 21 Apr 2017 06:14:38 +0000 (06:14 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Fri, 21 Apr 2017 06:14:38 +0000 (06:14 +0000)
This patch eliminates the following warning

lib/IR/AsmWriter.cpp:1128:57: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
                 (StrVal[1] >= '0' && StrVal[1] <= '9')) &&

Reviewers: timshen, rnk, davide
Reviewed By: davide
Subscribers: davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D32337

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300950 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/AsmWriter.cpp

index 27f6e36..b7de071 100644 (file)
@@ -1123,10 +1123,10 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
         // "Inf" or NaN, that atof will accept, but the lexer will not.  Check
         // that the string matches the "[-+]?[0-9]" regex.
         //
-        assert((StrVal[0] >= '0' && StrVal[0] <= '9') ||
-               ((StrVal[0] == '-' || StrVal[0] == '+') &&
-                (StrVal[1] >= '0' && StrVal[1] <= '9')) &&
-                   "[-+]?[0-9] regex does not match!");
+        assert(((StrVal[0] >= '0' && StrVal[0] <= '9') ||
+                ((StrVal[0] == '-' || StrVal[0] == '+') &&
+                 (StrVal[1] >= '0' && StrVal[1] <= '9'))) &&
+               "[-+]?[0-9] regex does not match!");
         // Reparse stringized version!
         if (APFloat(APFloat::IEEEdouble(), StrVal).convertToDouble() == Val) {
           Out << StrVal;