llvm-project/libcxx/src
Louis Dionne f3966eaf86 [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
2022-06-07 16:33:53 -04:00
..
experimental [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
filesystem Fix "the the" typo in documentation and user facing strings 2022-05-05 17:52:08 +02:00
include [libc++] Don't use static constexpr in headers. 2022-06-07 18:47:44 +02:00
ryu [libc++] Move everything related solely to _LIBCPP_ASSERT to its own file 2022-02-16 12:49:50 -05:00
support [libc++] Move everything related solely to _LIBCPP_ASSERT to its own file 2022-02-16 12:49:50 -05:00
CMakeLists.txt [libc++] Make the Debug mode a configuration-time only option 2022-06-07 16:33:53 -04:00
algorithm.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
any.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
assert.cpp [libc++] Add a lightweight overridable assertion handler 2022-03-23 15:35:46 -04:00
atomic.cpp [libc++] Split a few utilities out of __threading_support 2022-01-18 12:23:44 -05:00
barrier.cpp [libc++] Remove conditional include 2022-05-25 10:04:54 -04:00
bind.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
charconv.cpp [libc++] Lets to_chars use header implementation. 2022-06-02 17:11:32 +02:00
chrono.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
chrono_system_time_init.h Ensure newlines at the end of files (NFC) 2021-12-26 08:51:06 -08:00
condition_variable.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
condition_variable_destructor.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
debug.cpp [libc++] Move everything related solely to _LIBCPP_ASSERT to its own file 2022-02-16 12:49:50 -05:00
exception.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
format.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
functional.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
future.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
hash.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
ios.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
ios.instantiations.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
iostream.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
iostream_init.h Ensure newlines at the end of files (NFC) 2021-12-26 08:51:06 -08:00
legacy_debug_handler.cpp [libc++] Add a lightweight overridable assertion handler 2022-03-23 15:35:46 -04:00
legacy_pointer_safety.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
locale.cpp [libcxx] Fix the error checking for wctob_l, fixing locale narrow function on Windows 2022-02-25 23:44:23 +02:00
memory.cpp [libc++][NFC] Fix whitespace 2022-05-26 16:52:23 -04:00
mutex.cpp [libc++] Move everything related solely to _LIBCPP_ASSERT to its own file 2022-02-16 12:49:50 -05:00
mutex_destructor.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
new.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
optional.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
random.cpp [libcxx] random_device, specify optimal entropy properties for all OS's using arc4random() 2022-03-28 22:43:11 -04:00
random_shuffle.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
regex.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
shared_mutex.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
stdexcept.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
string.cpp [libc++][NFC] Whitespace refactoring of string.cpp for consistency and legibility 2022-05-24 11:32:00 -04:00
strstream.cpp [libc++] Move everything related solely to _LIBCPP_ASSERT to its own file 2022-02-16 12:49:50 -05:00
system_error.cpp [libc++] Define legacy symbols for inline functions at a finer-grained level 2022-04-12 13:44:30 -04:00
thread.cpp [libc++] Avoid lifetime UB in __thread_local_data() 2022-04-25 14:56:44 -07:00
typeinfo.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
utility.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
valarray.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
variant.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00
vector.cpp [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI. 2022-02-15 13:00:46 -05:00