|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, 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, 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, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, 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 |
|
| #
3a55353f |
| 25-Jul-2022 |
Louis Dionne <[email protected]> |
[libc++] Rename __libcpp_assertion_handler to __libcpp_verbose_abort
With the goal of reusing that handler to do other things besides handling assertions (such as terminating when an exception is th
[libc++] Rename __libcpp_assertion_handler to __libcpp_verbose_abort
With the goal of reusing that handler to do other things besides handling assertions (such as terminating when an exception is thrown under -fno-exceptions), the name `__libcpp_assertion_handler` doesn't really make sense anymore.
Furthermore, I didn't want to use the name `__libcpp_abort_handler`, since that would give the impression that the handler is called whenever `std::abort()` is called, which is not the case at all.
Differential Revision: https://reviews.llvm.org/D130562
(cherry picked from commit 507125af3d0b953cb56bce2e5b8000249fe1ef53)
show more ...
|
| #
7de5aca8 |
| 25-Jul-2022 |
Louis Dionne <[email protected]> |
[libc++] Generalize the customizeable assertion handler
Instead of taking a fixed set of arguments, use variadics so that we can pass arbitrary arguments to the handler. This is the first step towar
[libc++] Generalize the customizeable assertion handler
Instead of taking a fixed set of arguments, use variadics so that we can pass arbitrary arguments to the handler. This is the first step towards using the handler to handle other non-assertion-related failures, like std::unreachable and an exception being thrown in -fno-exceptions mode, which would improve user experience by including additional information in crashes (right now, we call abort() without additional information).
Differential Revision: https://reviews.llvm.org/D130507
show more ...
|
|
Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
| #
f3966eaf |
| 01-Apr-2022 |
Louis Dionne <[email protected]> |
[libc++] Make the Debug mode a configuration-time only option
The debug mode has been broken pretty much ever since it was shipped because it was possible to enable the debug mode in user code witho
[libc++] Make the Debug mode a configuration-time only option
The debug mode has been broken pretty much ever since it was shipped because it was possible to enable the debug mode in user code without actually enabling it in the dylib, leading to ODR violations that caused various kinds of failures.
This commit makes the debug mode a knob that is configured when building the library and which can't be changed afterwards. This is less flexible for users, however it will actually work as intended and it will allow us, in the future, to add various kinds of checks that do not assume the same ABI as the normal library. Furthermore, this will make the debug mode more robust, which means that vendors might be more tempted to support it properly, which hasn't been the case with the current debug mode.
This patch shouldn't break any user code, except folks who are building against a library that doesn't have the debug mode enabled and who try to enable the debug mode in their code. Such users will get a compile-time error explaining that this configuration isn't supported anymore.
In the future, we should further increase the granularity of the debug mode checks so that we can cherry-pick which checks to enable, like we do for unspecified behavior randomization.
Differential Revision: https://reviews.llvm.org/D122941
show more ...
|
| #
0a77e633 |
| 06-Apr-2022 |
Arthur Eubanks <[email protected]> |
[libcxx] Add flag to disable __builtin_assume in _LIBCPP_ASSERT
Introduce _LIBCPP_ASSERTIONS_DISABLE_ASSUME which makes _LIBCPP_ASSERT not call __builtin_assume when _LIBCPP_ENABLE_ASSERTIONS == 0.
[libcxx] Add flag to disable __builtin_assume in _LIBCPP_ASSERT
Introduce _LIBCPP_ASSERTIONS_DISABLE_ASSUME which makes _LIBCPP_ASSERT not call __builtin_assume when _LIBCPP_ENABLE_ASSERTIONS == 0.
Calling __builtin_assume was introduced in D122397.
__builtin_assume is generally supposed to improve optimizations, but can cause regressions when LLVM has trouble handling the calls to `llvm.assume()` (see comments in D122397).
Reviewed By: philnik
Differential Revision: https://reviews.llvm.org/D123175
show more ...
|
| #
f0799465 |
| 24-Mar-2022 |
Louis Dionne <[email protected]> |
[libc++] Use __builtin_expect and __builtin_assume in _LIBCPP_ASSERT
Since we expect the condition to be true most of the time, we might as well tell the compiler. And when assertions are disabled,
[libc++] Use __builtin_expect and __builtin_assume in _LIBCPP_ASSERT
Since we expect the condition to be true most of the time, we might as well tell the compiler. And when assertions are disabled, we might as well tell the compiler that it's allowed to assume that the condition holds.
Differential Revision: https://reviews.llvm.org/D122397
show more ...
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3 |
|
| #
b0fd9497 |
| 03-Mar-2022 |
Louis Dionne <[email protected]> |
[libc++] Add a lightweight overridable assertion handler
This patch adds a lightweight assertion handler mechanism that can be overriden at link-time in a fashion similar to `operator new`.
This is
[libc++] Add a lightweight overridable assertion handler
This patch adds a lightweight assertion handler mechanism that can be overriden at link-time in a fashion similar to `operator new`.
This is a third take on https://llvm.org/D121123 (which allowed customizing the assertion handler at compile-time), and https://llvm.org/D119969 (which allowed customizing the assertion handler at runtime only).
This approach is, I think, the best of all three explored approaches. Indeed, replacing the assertion handler in user code is ergonomic, yet we retain the ability to provide a custom assertion handler when deploying to older platforms that don't have a default handler in the dylib.
As-is, this patch provides a pretty good amount of backwards compatibility with the previous debug mode:
- Code that used to set _LIBCPP_DEBUG=0 in order to get basic assertions in their code will still get basic assertions out of the box, but those assertions will be using the new assertion handler support. - Code that was previously compiled with references to __libcpp_debug_function and friends will work out-of-the-box, no changes required. This is because we provide the same symbols in the dylib as we used to. - Code that used to set a custom __libcpp_debug_function will stop compiling, because we don't provide that declaration anymore. Users will have to migrate to the new way of setting a custom assertion handler, which is extremely easy. I suspect that pool of users is very limited, so breaking them at compile-time is probably acceptable.
The main downside of this approach is that code being compiled with assertions enabled but deploying to an older platform where the assertion handler didn't exist yet will fail to compile. However users can easily fix the problem by providing a custom assertion handler and defining the _LIBCPP_AVAILABILITY_CUSTOM_ASSERTION_HANDLER_PROVIDED macro to let the library know about the custom handler. In a way, this is actually a feature because it avoids a load-time error that one would otherwise get when trying to run the code on the older target.
Differential Revision: https://reviews.llvm.org/D121478
show more ...
|
| #
95c0f2d1 |
| 07-Mar-2022 |
Louis Dionne <[email protected]> |
[libc++] Remove workarounds for re-defining _LIBCPP_ASSERT in the test suite
As a fly-by fix, enable the complexity-changing assertions in __debug_less only when the full debug mode is enabled, sinc
[libc++] Remove workarounds for re-defining _LIBCPP_ASSERT in the test suite
As a fly-by fix, enable the complexity-changing assertions in __debug_less only when the full debug mode is enabled, since debugging level 0 is usually understood to only contain basic assertions that do not change the complexity of algorithms.
Differential Revision: https://reviews.llvm.org/D121129
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc2 |
|
| #
f87aa19b |
| 14-Feb-2022 |
Louis Dionne <[email protected]> |
[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
[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
show more ...
|