[clang] [clang] Add deprecation warning for `-Ofast` driver option (PR #98736)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 16 04:04:00 PDT 2024


================
@@ -442,6 +442,9 @@ def warn_drv_deprecated_arg : Warning<
 def warn_drv_deprecated_arg_no_relaxed_template_template_args : Warning<
   "argument '-fno-relaxed-template-template-args' is deprecated">,
   InGroup<DeprecatedNoRelaxedTemplateTemplateArgs>;
+def warn_drv_deprecated_arg_ofast : Warning<
+  "argument '-Ofast' is deprecated; use '-O3', possibly with '-ffast-math'">,
----------------
AaronBallman wrote:

How about a slight rewording?

`use '-O3 -ffast math' for the same behavior, or '-O3' to enable conforming optimizations only`

(I mostly want to drop "just" and to make it more clear that `-Ofast` was non-conforming because of `-ffast-math`.)

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


More information about the cfe-commits mailing list