|
Revision tags: llvmorg-21-init |
|
| #
bbd871e2 |
| 17-Jan-2025 |
Louis Dionne <ldionne.2@gmail.com> |
[libc++] Don't implement <stdatomic.h> before C++23 (#123130)
https://github.com/llvm/llvm-project/pull/95498 implemented a libc++
extension where <stdatomic.h> would forward to <atomic> even befor
[libc++] Don't implement <stdatomic.h> before C++23 (#123130)
https://github.com/llvm/llvm-project/pull/95498 implemented a libc++
extension where <stdatomic.h> would forward to <atomic> even before
C++23. Unfortunately, this was found to be a breaking change (with
fairly widespread impact) since that changes whether _Atomic(T) is a C
style atomic or std::atomic<T>. In principle, this can even be an ABI
break.
We generally don't implement extensions in libc++ because they cause so
many problems, and that extension had been accepted because it was
deemed pretty small and only a quality of life improvement. Since it has
widespread impact on valid C++20 (and before) code, this patch removes
the extension before we ship it in any public release.
show more ...
|
|
Revision tags: llvmorg-19.1.7 |
|
| #
b9a2658a |
| 21-Dec-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++][C++03] Use `__cxx03/` headers in C++03 mode (#109002)
This patch implements the forwarding to frozen C++03 headers as discussed in https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-
[libc++][C++03] Use `__cxx03/` headers in C++03 mode (#109002)
This patch implements the forwarding to frozen C++03 headers as discussed in https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc. In the RFC, we initially proposed selecting the right headers from the Clang driver, however consensus seemed to steer towards handling this in the library itself. This patch implements that direction.
At a high level, the changes basically amount to making each public header look like this:
``` // inside <vector> #ifdef _LIBCPP_CXX03_LANG # include <__cxx03/vector> #else // normal <vector> content #endif ```
In most cases, public headers are simple umbrella headers so there isn't much code in the #else branch. In other cases, the #else branch contains the actual implementation of the header.
show more ...
|
|
Revision tags: llvmorg-19.1.6 |
|
| #
c166a9c7 |
| 10-Dec-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Add #if 0 block to all the top-level headers (#119234)
Including The frozen C++03 headers results in a lot of formatting changes in the main headers, so this splits these changes into a sep
[libc++] Add #if 0 block to all the top-level headers (#119234)
Including The frozen C++03 headers results in a lot of formatting changes in the main headers, so this splits these changes into a separate commit instead.
This is part of https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc.
show more ...
|
| #
0e34f3f4 |
| 09-Dec-2024 |
Louis Dionne <ldionne.2@gmail.com> |
[libc++] Extract a clean base support API for std::atomic (#118129)
This patch documents the underlying API for implementing atomics on a
platform.
This doesn't change the operations that std::a
[libc++] Extract a clean base support API for std::atomic (#118129)
This patch documents the underlying API for implementing atomics on a
platform.
This doesn't change the operations that std::atomic is based on, but it
reorganizes the C11 / GCC implementation split to make it clearer what's
the base support layer and what's not.
show more ...
|
|
Revision tags: llvmorg-19.1.5 |
|
| #
3a634076 |
| 19-Nov-2024 |
Louis Dionne <ldionne.2@gmail.com> |
[libc++] Make __atomic_base into an implementation detail of std::atomic (#115764)
The __atomic_base base class is only useful to conditionalize the
operations we provide inside std::atomic. It sho
[libc++] Make __atomic_base into an implementation detail of std::atomic (#115764)
The __atomic_base base class is only useful to conditionalize the
operations we provide inside std::atomic. It shouldn't be used directly
from other places in the library which can use std::atomic directly
instead.
Since we've granularized our includes, using std::atomic directly should
not make much of a difference compile-time wise.
This patch starts using std::atomic directly from other classes like
std::barrier and std::latch. Changing this shouldn't be an ABI break
since both classes have the same size and layout.
The benefits of this patch are isolating other parts of the code base
from implementation details of std::atomic and simplifying the mental
model for std::atomic's layers of implementation by making it clear that
__atomic_base is only an implementation detail of std::atomic.
show more ...
|
|
Revision tags: llvmorg-19.1.4 |
|
| #
e99c4906 |
| 31-Oct-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Granularize <cstddef> includes (#108696)
|
|
Revision tags: llvmorg-19.1.3, llvmorg-19.1.2 |
|
| #
ba87515f |
| 12-Oct-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++][RFC] Always define internal feature test macros (#89178)
Currently, the library-internal feature test macros are only defined if
the feature is not available, and always have the prefix
`
[libc++][RFC] Always define internal feature test macros (#89178)
Currently, the library-internal feature test macros are only defined if
the feature is not available, and always have the prefix
`_LIBCPP_HAS_NO_`. This patch changes that, so that they are always
defined and have the prefix `_LIBCPP_HAS_` instead. This changes the
canonical use of these macros to `#if _LIBCPP_HAS_FEATURE`, which means
that using an undefined macro (e.g. due to a missing include) is
diagnosed now. While this is rather unlikely currently, a similar change
in `<__configuration/availability.h>` caught a few bugs. This also
improves readability, since it removes the double-negation of `#ifndef
_LIBCPP_HAS_NO_FEATURE`.
The current patch only touches the macros defined in `<__config>`. If
people are happy with this approach, I'll make a follow-up PR to also
change the macros defined in `<__config_site>`.
show more ...
|
|
Revision tags: llvmorg-19.1.1 |
|
| #
2d26fc8c |
| 19-Sep-2024 |
Ryan Prichard <rprichard@google.com> |
[libc++] Enable C++ stdatomic.h for all C++ versions (#95498)
This extension is motivated by Android's use of libc++, where
<stdatomic.h> has redirected to <atomic> for many years, long before it
[libc++] Enable C++ stdatomic.h for all C++ versions (#95498)
This extension is motivated by Android's use of libc++, where
<stdatomic.h> has redirected to <atomic> for many years, long before it
was standardized in C++23.
When libc++'s stdatomic.h is included in C translation units, delegate
to the next stdatomic.h, which could come from Clang or libc.
show more ...
|
|
Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2 |
|
| #
bf1666fb |
| 31-Jul-2024 |
Louis Dionne <ldionne.2@gmail.com> |
[libc++] Drop support for the C++20 Synchronization Library before C++20 (#82008)
When we initially implemented the C++20 synchronization library, we
reluctantly accepted for the implementation to
[libc++] Drop support for the C++20 Synchronization Library before C++20 (#82008)
When we initially implemented the C++20 synchronization library, we
reluctantly accepted for the implementation to be backported to C++03
upon request from the person who provided the patch. This was when we
were only starting to have experience with the issues this can create,
so we flinched. Nowadays, we have a much stricter stance about not
backporting features to previous standards.
We have recently started fixing several bugs (and near bugs) in our
implementation of the synchronization library. A recurring theme during
these reviews has been how difficult to understand the current code is,
and upon inspection it becomes clear that being able to use a few recent
C++ features (in particular lambdas) would help a great deal. The code
would still be pretty intricate, but it would be a lot easier to reason
about the flow of callbacks through things like
__thread_poll_with_backoff.
As a result, this patch drops support for the synchronization library
before C++20. This makes us more strictly conforming and opens the door
to major simplifications, in particular around atomic_wait which was
supported all the way to C++03.
This change will probably have some impact on downstream users, however
since the C++20 synchronization library was added only in LLVM 10 (~3
years ago) and it's quite a niche feature, the set of people trying to
use this part of the library before C++20 should be reasonably small.
show more ...
|
|
Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init |
|
| #
dfddc0c4 |
| 18-Jul-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Include the rest of the detail headers by version in the umbrella headers (#96032)
This is a follow-up to #83740.
|
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7 |
|
| #
42ba740a |
| 21-May-2024 |
Damien L-G <dalg24@gmail.com> |
[libc++] Implement C++20 atomic_ref (#76647)
Implement the std::atomic_ref class template by reusing atomic_base_impl.
Based on the work from https://reviews.llvm.org/D72240
|
|
Revision tags: llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1 |
|
| #
40081a45 |
| 04-Mar-2024 |
Louis Dionne <ldionne.2@gmail.com> |
[libc++] Fix diagnostic for <stdatomic.h> before C++23 (#83351)
We normally try to issue a reasonable diagnostic when mixing
<stdatomic.h> and <atomic> before C++23. However, after granularizing
t
[libc++] Fix diagnostic for <stdatomic.h> before C++23 (#83351)
We normally try to issue a reasonable diagnostic when mixing
<stdatomic.h> and <atomic> before C++23. However, after granularizing
the <atomic> header, the check and the #error message was moved to
*after* the point where mixing both causes problems. When mixing both
headers, we would hence get the diagnostic burried under a pile of
previous diagnostics in e.g. __atomic/kill_dependency.h.
This patch moves the check earlier to restore the intended behavior. It
also switches from `#ifdef kill_dependency` to an explicit check of the
inclusion of the header and the Standard version, which seems to be more
reliable than checking whether a macro is defined.
show more ...
|
| #
37dca605 |
| 29-Feb-2024 |
Louis Dionne <ldionne.2@gmail.com> |
[libc++] Clean up includes of <__assert> (#80091)
Originally, we used __libcpp_verbose_abort to handle assertion failures.
That function was declared from all public headers. Since we don't use
th
[libc++] Clean up includes of <__assert> (#80091)
Originally, we used __libcpp_verbose_abort to handle assertion failures.
That function was declared from all public headers. Since we don't use
that mechanism anymore, we don't need to declare __libcpp_verbose_abort
from all public headers, and we can clean up a lot of unnecessary
includes.
This patch also moves the definition of the various assertion categories
to the <__assert> header, since we now rely on regular IWYU for these
assertion macros.
rdar://105510916
show more ...
|
| #
15300341 |
| 28-Feb-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Remove unnecessary includes from <atomic> (#82880)
This reduces the include time of `<atomic>` from 135ms to 88ms.
|
|
Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6 |
|
| #
6f0c52e5 |
| 22-Nov-2023 |
Louis Dionne <ldionne.2@gmail.com> |
[libc++] Refactor atomic_{unsigned,signed}_lock_free (#73041)
Their definition was a bit roundabout and it was actually wrong since
atomic_unsigned_lock_free would be a signed type whenever
__cxx_
[libc++] Refactor atomic_{unsigned,signed}_lock_free (#73041)
Their definition was a bit roundabout and it was actually wrong since
atomic_unsigned_lock_free would be a signed type whenever
__cxx_contention_t is lock free, which is most of the time.
Fixes #72968
show more ...
|
| #
de7fbfee |
| 22-Nov-2023 |
Hui <hui.xie0621@gmail.com> |
[libc++] Floating Point Atomic (#67799)
- implement P0020R6 Floating Point Atomic
Differential Revision: https://reviews.llvm.org/D153981
|
|
Revision tags: llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2 |
|
| #
70617a1a |
| 31-Jan-2023 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Granularize <atomic> includes
Reviewed By: ldionne, Mordante, #libc
Spies: arichardson, libcxx-commits
Differential Revision: https://reviews.llvm.org/D144255
|
|
Revision tags: llvmorg-16.0.0-rc1, llvmorg-17-init |
|
| #
46db8d82 |
| 14-Jan-2023 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Granularize <atomic>
Reviewed By: Mordante, #libc
Spies: arichardson, libcxx-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D142972
|
| #
4f15267d |
| 13-Feb-2023 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[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
[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
show more ...
|
| #
dc21ce44 |
| 15-Jan-2023 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Remove <type_traits> includes from <atomic> and <ratio>
Reviewed By: Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D141799
|
|
Revision tags: llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
| #
105fef5d |
| 20-Mar-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][chrono] Add calendar type formatters.
Some of the calendar types have landed before, this adds the missing set. Note this does not complete the implementation of the chrono formatters.
Thi
[libc++][chrono] Add calendar type formatters.
Some of the calendar types have landed before, this adds the missing set. Note this does not complete the implementation of the chrono formatters.
This removes the `chrono` header for some transitive include in C++17 mode. This is needed to avoid inclusion cycles.
Partially implements: - P1361 Integration of chrono with text formatting - P2372 Fixing locale handling in chrono formatters
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D137022
show more ...
|
| #
83c18162 |
| 22-Dec-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++] LWG3745 noexcept for atomic_wait.
The noexcept was already implemented, this only updates the synposis and adds tests to validate that the functions are noexcept.
This implements: - LWG374
[libc++] LWG3745 noexcept for atomic_wait.
The noexcept was already implemented, this only updates the synposis and adds tests to validate that the functions are noexcept.
This implements: - LWG3745 std::atomic_wait and its friends lack noexcept
Reviewed By: #libc, philnik
Differential Revision: https://reviews.llvm.org/D140575
show more ...
|
| #
841399a2 |
| 13-Aug-2022 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Add custom clang-tidy checks
Reviewed By: #libc, ldionne
Spies: jwakely, beanz, smeenai, cfe-commits, tschuett, avogelsgesang, Mordante, sstefan1, libcxx-commits, ldionne, mgorny, arichard
[libc++] Add custom clang-tidy checks
Reviewed By: #libc, ldionne
Spies: jwakely, beanz, smeenai, cfe-commits, tschuett, avogelsgesang, Mordante, sstefan1, libcxx-commits, ldionne, mgorny, arichardson, miyuki
Differential Revision: https://reviews.llvm.org/D131963
show more ...
|
| #
ed2d3644 |
| 01-Oct-2022 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++][NFC] Prefer type aliases over structs
Reviewed By: ldionne, #libc
Spies: sstefan1, libcxx-commits, jeroen.dobbelaere
Differential Revision: https://reviews.llvm.org/D134901
|
| #
ddb6c2b3 |
| 19-Sep-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++] Rewrites graph_header_deps.py.
The new version is a lot simpler and has less option which were not used. This uses the CSV files as generated by D133127 as input data.
The current Python s
[libc++] Rewrites graph_header_deps.py.
The new version is a lot simpler and has less option which were not used. This uses the CSV files as generated by D133127 as input data.
The current Python script has more features but uses a simple "grep" making the output less accurate: - Conditionally included header are always included. This is an issue since part of our includes are unneeded transitive includes. Based on the language version they may be omitted. The script however always includes them. - Includes in comments are processed as-if they are includes. This is an issue when comments explain how certain data is generated; of course there are digraphs which the script omits.
This implementation uses Clang's --trace-includes to generate the includes per header. This means the input of the generation script always has the real list of includes.
Libc++ is moving from large monolithic Standard headers to more fine grained headers. For example, algorithm includes every header in `__algorithm`. Adding all these detail headers in the graph makes the output unusable. Instead it only shows the Standard headers. The transitive includes of the detail headers are parsed and "attributed" to the Standard header including them. This gives an accurate include graph without the unneeded clutter. Note that this graph is still big.
This changes fixes the cyclic dependency issue with the previous version of the tool so the markers and its documentation is removed.
Since the input has no cycles the CI test is removed.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D134188
show more ...
|