[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

Mehdi AMINI via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 15 10:57:14 PST 2016


mehdi_amini added inline comments.


================
Comment at: include/clang/Driver/Options.td:1324
+  HelpText<"Use C++ undefined behaviour optimization for control flow paths"
+     "that reach the end of the function without executing a required return">;
+def fno_strict_return : Flag<["-"], "fno-strict-return">, Group<f_Group>,
----------------
Quuxplusone wrote:
> Nit: looks like Clang spells it "behavior"?
> 
> Nit: I'm still pedantically uncomfortable with describing the strict-return behavior as an "optimization". I suggest rephrasing this as "-fstrict-return: Treat control flow paths that fall off the end of a non-void function as unreachable."
> 
> (I notice that neither -fstrict-aliasing nor -fstrict-overflow have any help text at all.)
>  I suggest rephrasing this as "-fstrict-return: Treat control flow paths that fall off the end of a non-void function as unreachable."

Is it an accurate description? `-fno-strict-return` would only disable this for trivial types.


Repository:
  rL LLVM

https://reviews.llvm.org/D27163





More information about the cfe-commits mailing list