[libc++][hardening][NFC] Introduce `_LIBCPP_ASSERT_UNCATEGORIZED`.
authorvarconst <varconsteq@gmail.com>
Tue, 27 Jun 2023 23:40:39 +0000 (16:40 -0700)
committervarconst <varconsteq@gmail.com>
Wed, 28 Jun 2023 22:10:31 +0000 (15:10 -0700)
commitcd0ad4216cb962f160b1b0054df6f72ce6f9f766
tree98f2f5f3ae1c721e9e954d374fe2b316ee86be96
parent699e0bed4bfead826e210025bf33e5a1997c018b
[libc++][hardening][NFC] Introduce `_LIBCPP_ASSERT_UNCATEGORIZED`.

Replace most uses of `_LIBCPP_ASSERT` with
`_LIBCPP_ASSERT_UNCATEGORIZED`.

This is done as a prerequisite to introducing hardened mode to libc++.
The idea is to make enabling assertions an opt-in with (somewhat)
fine-grained controls over which categories of assertions are enabled.
The vast majority of assertions are currently uncategorized; the new
macro will allow turning on `_LIBCPP_ASSERT` (the underlying mechanism
for all kinds of assertions) without enabling all the uncategorized
assertions (in the future; this patch preserves the current behavior).

Differential Revision: https://reviews.llvm.org/D153816
101 files changed:
libcxx/include/__algorithm/clamp.h
libcxx/include/__algorithm/pop_heap.h
libcxx/include/__algorithm/ranges_clamp.h
libcxx/include/__algorithm/ranges_max.h
libcxx/include/__algorithm/ranges_min.h
libcxx/include/__algorithm/ranges_minmax.h
libcxx/include/__algorithm/sample.h
libcxx/include/__algorithm/sift_down.h
libcxx/include/__algorithm/sort.h
libcxx/include/__assert
libcxx/include/__bit/bit_ceil.h
libcxx/include/__charconv/from_chars_integral.h
libcxx/include/__charconv/to_chars_base_10.h
libcxx/include/__charconv/to_chars_integral.h
libcxx/include/__charconv/traits.h
libcxx/include/__chrono/parser_std_format_spec.h
libcxx/include/__coroutine/coroutine_handle.h
libcxx/include/__debug_utils/strict_weak_ordering_check.h
libcxx/include/__expected/expected.h
libcxx/include/__filesystem/directory_iterator.h
libcxx/include/__filesystem/path_iterator.h
libcxx/include/__format/buffer.h
libcxx/include/__format/format_arg.h
libcxx/include/__format/format_string.h
libcxx/include/__format/formatter_bool.h
libcxx/include/__format/formatter_floating_point.h
libcxx/include/__format/formatter_integral.h
libcxx/include/__format/formatter_output.h
libcxx/include/__format/formatter_string.h
libcxx/include/__format/parser_std_format_spec.h
libcxx/include/__format/range_formatter.h
libcxx/include/__format/unicode.h
libcxx/include/__functional/function.h
libcxx/include/__hash_table
libcxx/include/__iterator/advance.h
libcxx/include/__iterator/bounded_iter.h
libcxx/include/__iterator/common_iterator.h
libcxx/include/__iterator/counted_iterator.h
libcxx/include/__iterator/next.h
libcxx/include/__iterator/prev.h
libcxx/include/__mdspan/extents.h
libcxx/include/__memory/assume_aligned.h
libcxx/include/__memory/construct_at.h
libcxx/include/__memory_resource/polymorphic_allocator.h
libcxx/include/__node_handle
libcxx/include/__numeric/gcd_lcm.h
libcxx/include/__pstl/internal/algorithm_impl.h
libcxx/include/__pstl/internal/numeric_impl.h
libcxx/include/__pstl/internal/parallel_backend_tbb.h
libcxx/include/__pstl/internal/parallel_backend_utils.h
libcxx/include/__random/negative_binomial_distribution.h
libcxx/include/__ranges/drop_view.h
libcxx/include/__ranges/drop_while_view.h
libcxx/include/__ranges/filter_view.h
libcxx/include/__ranges/iota_view.h
libcxx/include/__ranges/lazy_split_view.h
libcxx/include/__ranges/subrange.h
libcxx/include/__ranges/take_view.h
libcxx/include/__ranges/view_interface.h
libcxx/include/__stop_token/intrusive_list_view.h
libcxx/include/__stop_token/stop_state.h
libcxx/include/__string/char_traits.h
libcxx/include/__thread/thread.h
libcxx/include/__tree
libcxx/include/__utility/exception_guard.h
libcxx/include/__utility/is_pointer_in_range.h
libcxx/include/__utility/unreachable.h
libcxx/include/array
libcxx/include/deque
libcxx/include/experimental/memory_resource
libcxx/include/fstream
libcxx/include/future
libcxx/include/list
libcxx/include/locale
libcxx/include/map
libcxx/include/optional
libcxx/include/regex
libcxx/include/set
libcxx/include/span
libcxx/include/string
libcxx/include/string_view
libcxx/include/unordered_map
libcxx/include/unordered_set
libcxx/include/vector
libcxx/src/filesystem/directory_iterator.cpp
libcxx/src/filesystem/error.h
libcxx/src/filesystem/format_string.h
libcxx/src/filesystem/operations.cpp
libcxx/src/filesystem/posix_compat.h
libcxx/src/include/ryu/common.h
libcxx/src/include/ryu/d2s_intrinsics.h
libcxx/src/include/to_chars_floating_point.h
libcxx/src/memory_resource.cpp
libcxx/src/mutex.cpp
libcxx/src/ryu/d2fixed.cpp
libcxx/src/ryu/d2s.cpp
libcxx/src/ryu/f2s.cpp
libcxx/src/string.cpp
libcxx/src/strstream.cpp
libcxx/src/support/ibm/xlocale_zos.cpp
libcxx/src/system_error.cpp