[clang] Fix a warning
authorKazu Hirata <kazu@google.com>
Fri, 14 Oct 2022 15:36:59 +0000 (08:36 -0700)
committerKazu Hirata <kazu@google.com>
Fri, 14 Oct 2022 15:36:59 +0000 (08:36 -0700)
This patch fixes:

  clang/lib/CodeGen/CGCall.cpp:1867:64: error: '&&' within '||'
  [-Werror,-Wlogical-op-parentheses]

clang/lib/CodeGen/CGCall.cpp

index 146271f..a59d702 100644 (file)
@@ -1863,9 +1863,9 @@ void CodeGenModule::getDefaultFunctionAttributes(StringRef Name,
     if (LangOpts.ApproxFunc)
       FuncAttrs.addAttribute("approx-func-fp-math", "true");
     if ((LangOpts.FastMath ||
-         !LangOpts.FastMath && LangOpts.AllowFPReassoc && LangOpts.AllowRecip &&
-             !LangOpts.FiniteMathOnly && LangOpts.NoSignedZero &&
-             LangOpts.ApproxFunc) &&
+         (!LangOpts.FastMath && LangOpts.AllowFPReassoc &&
+          LangOpts.AllowRecip && !LangOpts.FiniteMathOnly &&
+          LangOpts.NoSignedZero && LangOpts.ApproxFunc)) &&
         LangOpts.getDefaultFPContractMode() != LangOptions::FPModeKind::FPM_Off)
       FuncAttrs.addAttribute("unsafe-fp-math", "true");
     if (CodeGenOpts.SoftFloat)