[clang] [NFC] Refactor fast-math handling for clang driver (PR #81173)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 8 12:57:31 PST 2024


================
@@ -2842,9 +2862,8 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
             << Args.MakeArgString("-ffp-model=" + FPModel)
             << Args.MakeArgString("-ffp-model=" + Val);
       if (Val.equals("fast")) {
-        optID = options::OPT_ffast_math;
         FPModel = Val;
-        FPContract = "fast";
+        applyFastMath();
----------------
andykaylor wrote:

I'm pretty sure it is NFC. We have tests that verify this ([clang/test/Driver/fp-model.c](https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/fp-model.c) and [clang/test/Driver/fast-math.c](https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/fast-math.c)). I'm only changing where the local variables are set. The FPContract value that was being set here was also being set in the OPT_ffast_math handler. Now both places call the lambda for everything they set.

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


More information about the cfe-commits mailing list