[libcxx-commits] [PATCH] D141812: [libc++] Introduce _LIBCPP_HIDE_FROM_ABI_NAMESPACE_STD

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 15 17:07:35 PST 2023


philnik created this revision.
philnik added reviewers: ldionne, Mordante, var-const.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

We've added _LIBCPP_HIDE_FROM_ABI to a lot of functions lately, because we now have a clang-tidy check that makes sure we add it to all the functions that need it. Because of that a lot of functions are marked `[[gnu::always_inline]]` with GCC, which results in GCC taking a lot longer to compile with libc++. This patch introduces `_LIBCPP_HIDE_FROM_ABI_NAMESPACE`, which fulfills the same purpose as adding `_LIBCPP_HIDE_FROM_ABI` to the functions inside it. It also avoids a lot of `_LIBCPP_HIDE_FROM_ABI` annotations, since it can be used for a lot of functions, instead of having to mark every single one. Structs and ABI-sensitive functions should not be places inside this namespace, since the ABI will change with bumping the libc++ version macro. To avoid having structs inside the namespace or having functions unnecessairly marked `_LIBCPP_HIDE_FROM_ABI`, this patch also adds clang-tidy checks for these cases.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141812

Files:
  libcxx/include/__algorithm/any_of.h
  libcxx/include/__config
  libcxx/test/tools/clang_tidy_checks/hide_from_abi.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141812.489408.patch
Type: text/x-patch
Size: 4160 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230116/d4dde7d5/attachment.bin>


More information about the libcxx-commits mailing list