[clang] [NFC] Add assertion to ensure FiniteMathOnly is in sync with HonorINFs and HonorNANs. (PR #97342)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 8 13:49:28 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 727ecaf7d16d44ecf434284c60ad65b22d814092 3a6cc060a0b91e2d960ea92a1d307a0bae3893f4 -- clang/include/clang/Basic/LangOptions.h clang/lib/Driver/ToolChains/Clang.cpp clang/test/CodeGen/fp-floatcontrol-stack.cpp clang/test/Sema/warn-infinity-nan-disabled-lnx.cpp clang/test/Sema/warn-infinity-nan-disabled-win.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 1b799fb31b..65257e3c4c 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3305,7 +3305,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
   for (auto *Arg : Args.filtered(options::OPT_Xclang)) {
     processArg(Arg);
   }
-  if ((!HonorINFs && !HonorNaNs)  || (!NanValues && !InfValues))
+  if ((!HonorINFs && !HonorNaNs) || (!NanValues && !InfValues))
     CmdArgs.push_back("-ffinite-math-only");
 
   if (const Arg *A = Args.getLastArg(options::OPT_mfpmath_EQ)) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/97342


More information about the cfe-commits mailing list