Commit Graph

13 Commits

Author SHA1 Message Date
Nikolas Klauser
83ce139721 [libc++] Add hide_from_abi check for classes
We already have a clang-tidy check for making sure that `_LIBCPP_HIDE_FROM_ABI` is on free functions. This patch extends this to class members. The places where we don't check for `_LIBCPP_HIDE_FROM_ABI` are classes for which we have an instantiation in the library.

Reviewed By: ldionne, Mordante, #libc

Spies: jplehr, mikhail.ramalho, sstefan1, libcxx-commits, krytarowski, miyuki, smeenai

Differential Revision: https://reviews.llvm.org/D142332
2023-04-16 15:23:23 +02:00
Nikolas Klauser
4f15267d3d [libc++][NFC] Replace _LIBCPP_STD_VER > x with _LIBCPP_STD_VER >= x
This change is almost fully mechanical. The only interesting change is in `generate_feature_test_macro_components.py` to generate `_LIBCPP_STD_VER >=` instead. To avoid churn in the git-blame this commit should be added to the `.git-blame-ignore-revs` once committed.

Reviewed By: ldionne, var-const, #libc

Spies: jloser, libcxx-commits, arichardson, arphaman, wenlei

Differential Revision: https://reviews.llvm.org/D143962
2023-02-15 16:52:25 +01:00
Nikolas Klauser
fafed06b2e [libc++] Granularize <type_traits> includes in <bit>, <numbers> and <coroutine>
`<coroutine>` seems to be new enough to not be a huge problem.

Reviewed By: Mordante, #libc

Spies: libcxx-commits, ChuanqiXu

Differential Revision: https://reviews.llvm.org/D140600
2023-01-21 15:09:21 +01:00
Louis Dionne
3fe2db8cf9 [libc++] Remove _LIBCPP_HAS_NO_CXX20_COROUTINES
As far as I can tell, all the compilers we support have support for
C++20 coroutines now.

Differential Revision: https://reviews.llvm.org/D135274
2022-10-12 10:42:06 -04:00
Nikolas Klauser
ed2d3644ab [libc++][NFC] Prefer type aliases over structs
Reviewed By: ldionne, #libc

Spies: sstefan1, libcxx-commits, jeroen.dobbelaere

Differential Revision: https://reviews.llvm.org/D134901
2022-10-01 22:49:36 +02:00
Nikolas Klauser
5fab33af7f [libc++] Avoid instantiating type_trait classes
Use `using` aliases to avoid instantiating lots of types

Reviewed By: ldionne, #libc

Spies: libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D132785
2022-09-06 19:09:42 +02:00
Louis Dionne
368faacac7 [libc++] Revert "Protect users from relying on detail headers" & related changes
This commit reverts 5aaefa51 (and also partly 7f285f48e7 and b6d75682f9,
which were related to the original commit). As landed, 5aaefa51 had
unintended consequences on some downstream bots and didn't have proper
coverage upstream due to a few subtle things. Implementing this is
something we should do in libc++, however we'll first need to address
a few issues listed in https://reviews.llvm.org/D106124#3349710.

Differential Revision: https://reviews.llvm.org/D120683
2022-03-01 08:20:24 -05:00
Christopher Di Bella
5aaefa510e [libcxx][modules] protects users from relying on detail headers
libc++ has started splicing standard library headers into much more
fine-grained content for maintainability. It's very likely that outdated
and naive tooling (some of which is outside of LLVM's scope) will
suggest users include things such as <__ranges/access.h> instead of
<ranges>, and Hyrum's law suggests that users will eventually begin to
rely on this without the help of tooling. As such, this commit
intends to protect users from themselves, by making it a hard error for
anyone outside of the standard library to include libc++ detail headers.

Differential Revision: https://reviews.llvm.org/D106124
2022-02-26 09:00:25 +00:00
Louis Dionne
f87aa19be6 [libc++] Move everything related solely to _LIBCPP_ASSERT to its own file
This is the first step towards disentangling the debug mode and assertions
in libc++. This patch doesn't make any functional change: it simply moves
_LIBCPP_ASSERT-related stuff to its own file so as to make it clear that
libc++ assertions and the debug mode are different things. Future patches
will make it possible to enable assertions without enabling the debug
mode.

Differential Revision: https://reviews.llvm.org/D119769
2022-02-16 12:49:50 -05:00
Arthur O'Dwyer
fa6b9e4010 [libc++] Normalize all our '#pragma GCC system_header', and regression-test.
Now we'll notice if a header forgets to include this magic phrase.

Differential Revision: https://reviews.llvm.org/D118800
2022-02-04 12:27:19 -05:00
Chuanqi Xu
6441536c27 [libcxx] [Coroutines] Support noop_coroutine for GCC
We didn't support noop_coroutine for GCC in previous conforming patch.
So that GCC couldn't use noop_coroutine() defined in <coroutine>. And
after this patch, GCC should be able to compile the whole <coroutine>
header.

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D116144
2021-12-27 13:53:21 +08:00
Louis Dionne
c0f87e8382 [libc++] Remove _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
All supported compilers support spaceship in C++20 nowadays.

Differential Revision: https://reviews.llvm.org/D113938
2021-11-17 10:59:57 -05:00
Chuanqi Xu
2e6ae1d3f2 [libcxx] [Coroutine] Conform Coroutine Implementation
Since coroutine is merged in C++ standard and the support for coroutine
seems relatively stable. It's the time to move the implementation of
coroutine out of the experimental directory and the std::experimental
namespace. This patch creates header <coroutine> with conformed
implementation with C++ standard. To avoid breaking user's code too
fast, the <experimental/coroutine> header is remained. Note that
<experimental/coroutine> is deprecated and it would be removed in
LLVM15.

Reviewed By: Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D109433
2021-11-16 14:13:13 +08:00