libcxx: update to LLVM 22

This commit is contained in:
Alex Rønne Petersen
2026-01-17 05:40:55 +01:00
parent 80212b03ff
commit dfabf1586f
425 changed files with 15930 additions and 10446 deletions
+10 -25
View File
@@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON
#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 14
template <bool>
struct __basic_string_common;
@@ -35,45 +35,30 @@ struct __basic_string_common<true> {
void __basic_string_common<true>::__throw_length_error() const { std::__throw_length_error("basic_string"); }
void __basic_string_common<true>::__throw_out_of_range() const { std::__throw_out_of_range("basic_string"); }
#endif // _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON
#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 14
// Define legacy ABI functions
// ---------------------------
#ifndef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
#if _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 21
// This initializes the string with [__s, __s + __sz), but capacity() == __reserve. Assumes that __reserve >= __sz.
template <class _CharT, class _Traits, class _Allocator>
void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve) {
if (__libcpp_is_constant_evaluated())
__rep_ = __rep();
if (__reserve > max_size())
__throw_length_error();
pointer __p;
if (__fits_in_sso(__reserve)) {
__set_short_size(__sz);
__p = __get_short_pointer();
} else {
auto __allocation = std::__allocate_at_least(__alloc_, __recommend(__reserve) + 1);
__p = __allocation.ptr;
__begin_lifetime(__p, __allocation.count);
__set_long_pointer(__p);
__set_long_cap(__allocation.count);
__set_long_size(__sz);
}
pointer __p = __init_internal_buffer(__reserve);
__annotate_delete();
__set_size(__sz);
traits_type::copy(std::__to_address(__p), __s, __sz);
traits_type::assign(__p[__sz], value_type());
__annotate_new(__sz);
}
# define STRING_LEGACY_API(CharT) \
template _LIBCPP_EXPORTED_FROM_ABI void basic_string<CharT>::__init(const value_type*, size_type, size_type)
STRING_LEGACY_API(char);
template _LIBCPP_EXPORTED_FROM_ABI void basic_string<char>::__init(const value_type*, size_type, size_type);
# if _LIBCPP_HAS_WIDE_CHARACTERS
STRING_LEGACY_API(wchar_t);
template _LIBCPP_EXPORTED_FROM_ABI void basic_string<wchar_t>::__init(const value_type*, size_type, size_type);
# endif
#endif // _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
#endif // _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 21
#define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template _LIBCPP_EXPORTED_FROM_ABI __VA_ARGS__;
#ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION