[clang] [clang] Make -fveclib={ArmPL, SLEEF} imply -fno-math-errno (PR #112580)

Paul Walker via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 21 04:25:39 PDT 2024


================
@@ -2960,6 +2969,12 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
   }
 
   for (const Arg *A : Args) {
+    auto CheckMathErrnoForVecLib =
+        llvm::make_scope_exit([&, MathErrnoBeforeArg = MathErrno] {
+          if (NoMathErrnoWasImpliedByVecLib && !MathErrnoBeforeArg && MathErrno)
+            ArgThatEnabledMathErrnoAfterVecLib = A;
+        });
----------------
paulwalker-arm wrote:

I don't think we need such complexity.  Given all the variables exist you can just clear `ArgThatEnabledMathErrnoAfterVecLib` within the `OPT_fveclib` case block and then have

```
if (NoMathErrnoWasImpliedByVecLib && !ArgThatEnabledMathErrnoAfterVecLib && MathErrno)
  ArgThatEnabledMathErrnoAfterVecLib = A
```
just before we claim `A` after the switch block.
  

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


More information about the cfe-commits mailing list