[PATCH] D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 28 14:17:23 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticFrontendKinds.td:52-53
+def err_incompatible_fp_eval_method_options : Error<
+    "option 'ffp-eval-method' cannot be used with"
+    " %select{option 'fapprox-func'|option 'mreassociate'|option 'freciprocal'}0.">;
+
----------------



================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:6479-6481
+  "%select{'#pragma clang fp eval_method'|option 'ffp-eval-method'}0 cannot be used when"
+  " %select{option 'fapprox_func'|option 'mreassociate'|option 'freciprocal'|option 'ffp-eval-method'|'#pragma clang fp reassociate'}1"
+  " is enabled.">;
----------------



================
Comment at: clang/test/Sema/eval-method-with-unsafe-math.c:52
+
+// CHECK-FE-FUNC: (frontend): option 'ffp-eval-method' cannot be used with option 'fapprox-func'.
+// CHECK-FE-ASSOC: (frontend): option 'ffp-eval-method' cannot be used with option 'mreassociate'.
----------------
Can you split the driver tests into their own file in the `Driver` directory?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122155/new/

https://reviews.llvm.org/D122155



More information about the cfe-commits mailing list