[PATCH] D123345: Treat `std::move`, `forward`, and `move_if_noexcept` as builtins.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 15 04:28:06 PDT 2022


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

In D123345#3452933 <https://reviews.llvm.org/D123345#3452933>, @rsmith wrote:

> In D123345#3452496 <https://reviews.llvm.org/D123345#3452496>, @aaron.ballman wrote:
>
>> Do you have ideas on how we can improve the debugging checkpoint behavior (if at all)?
>
> I think we just live with it, like we do for other builtin functions. (There might be things we can do by emitting inlining info into the debug info. If we do that, we should presumably do it for all builtin lib functions.)

Okie dokie, so be it.

The changes LGTM aside from a previous question about diagnostic wording (feel free to accept the suggestion or not as you see fit). Thanks for working on this!



================
Comment at: clang/docs/ReleaseNotes.rst:121-124
+- Improved ``-O0`` code generation for calls to ``std::move``, ``std::forward``,
+  and ``std::move_if_noexcept``. These are now treated as compiler builtins and
+  implemented directly, rather than instantiating the definition from the
+  standard library.
----------------
Probably worth moving down to the C++ language changes section because it's C++ specific.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:6577-6578
+// FIXME: This should also be in -Wc++23-compat once we have it.
+def warn_use_of_unaddressable_function : Warning<
+  "taking address of non-addressable standard library function">,
+  InGroup<CXX20Compat>;
----------------
aaron.ballman wrote:
> Thank you for making this one on by default :-)
Thoughts on this one?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123345



More information about the cfe-commits mailing list