authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-10-18 08:41:54-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-10-18 10:18:09-07:00
logd0a5ad0e4c74d36982dbc823dd80dc62395fe2bd
tree416985f5a105d9b20c7fbb4b5084649454b02bcc
parentfd10baf748aeb3b6d2394701d735098e64638a22

update libcxx to LLVM 15.0.3


6 files changed, 45 insertions(+), 56 deletions(-)

lib/libcxx/include/__config+20-13
......@@ -20,9 +20,21 @@
2020# pragma GCC system_header
2121#endif
2222
23#if defined(__apple_build_version__)
24# define _LIBCPP_COMPILER_CLANG_BASED
25# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000)
26#elif defined(__clang__)
27# define _LIBCPP_COMPILER_CLANG_BASED
28# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
29#elif defined(__GNUC__)
30# define _LIBCPP_COMPILER_GCC
31#elif defined(_MSC_VER)
32# define _LIBCPP_COMPILER_MSVC
33#endif
34
2335#ifdef __cplusplus
2436
25# define _LIBCPP_VERSION 15000
37# define _LIBCPP_VERSION 15003
2638
2739# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
2840# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
......@@ -196,18 +208,6 @@
196208# define __has_include(...) 0
197209# endif
198210
199# if defined(__apple_build_version__)
200# define _LIBCPP_COMPILER_CLANG_BASED
201# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000)
202# elif defined(__clang__)
203# define _LIBCPP_COMPILER_CLANG_BASED
204# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
205# elif defined(__GNUC__)
206# define _LIBCPP_COMPILER_GCC
207# elif defined(_MSC_VER)
208# define _LIBCPP_COMPILER_MSVC
209# endif
210
211211# if !defined(_LIBCPP_COMPILER_CLANG_BASED) && __cplusplus < 201103L
212212# error "libc++ only supports C++03 with Clang-based compilers. Please enable C++11"
213213# endif
......@@ -1099,6 +1099,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
10991099# define _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
11001100# endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
11011101
1102// Leave the deprecation notices in by default, but don't remove unary_function and
1103// binary_function entirely just yet. That way, folks will have one release to act
1104// on the deprecation warnings.
1105# ifndef _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
1106# define _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
1107# endif
1108
11021109# if defined(_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES)
11031110# define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
11041111# define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION
lib/libcxx/include/__functional/function.h+12-2
......@@ -883,7 +883,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
883883#endif // _LIBCPP_NO_RTTI
884884};
885885
886#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)
886#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME)
887887
888888extern "C" void *_Block_copy(const void *);
889889extern "C" void _Block_release(const void *);
......@@ -898,14 +898,22 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
898898public:
899899 _LIBCPP_INLINE_VISIBILITY
900900 explicit __func(__block_type const& __f)
901#ifdef _LIBCPP_HAS_OBJC_ARC
902 : __f_(__f)
903#else
901904 : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
905#endif
902906 { }
903907
904908 // [TODO] add && to save on a retain
905909
906910 _LIBCPP_INLINE_VISIBILITY
907911 explicit __func(__block_type __f, const _Alloc& /* unused */)
912#ifdef _LIBCPP_HAS_OBJC_ARC
913 : __f_(__f)
914#else
908915 : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
916#endif
909917 { }
910918
911919 virtual __base<_Rp(_ArgTypes...)>* __clone() const {
......@@ -921,8 +929,10 @@ public:
921929 }
922930
923931 virtual void destroy() _NOEXCEPT {
932#ifndef _LIBCPP_HAS_OBJC_ARC
924933 if (__f_)
925934 _Block_release(__f_);
935#endif
926936 __f_ = 0;
927937 }
928938
......@@ -950,7 +960,7 @@ public:
950960#endif // _LIBCPP_NO_RTTI
951961};
952962
953#endif // _LIBCPP_HAS_EXTENSION_BLOCKS && !_LIBCPP_HAS_OBJC_ARC
963#endif // _LIBCPP_HAS_EXTENSION_BLOCKS
954964
955965} // namespace __function
956966
lib/libcxx/include/atomic+9-37
......@@ -1113,6 +1113,12 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
11131113# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
11141114#endif
11151115
1116template <class _Tp>
1117struct __libcpp_is_always_lock_free {
1118 // __atomic_always_lock_free is available in all Standard modes
1119 static const bool __value = __atomic_always_lock_free(sizeof(_Tp), 0);
1120};
1121
11161122#ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
11171123
11181124template<typename _Tp>
......@@ -1404,42 +1410,8 @@ _Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a,
14041410 return __old;
14051411}
14061412
1407#ifdef __cpp_lib_atomic_is_always_lock_free
1408
1409template<typename _Tp> struct __cxx_is_always_lock_free {
1410 enum { __value = __atomic_always_lock_free(sizeof(_Tp), 0) }; };
1411
1412#else
1413
1414template<typename _Tp> struct __cxx_is_always_lock_free { enum { __value = false }; };
1415// Implementations must match the C ATOMIC_*_LOCK_FREE macro values.
1416template<> struct __cxx_is_always_lock_free<bool> { enum { __value = 2 == ATOMIC_BOOL_LOCK_FREE }; };
1417template<> struct __cxx_is_always_lock_free<char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
1418template<> struct __cxx_is_always_lock_free<signed char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
1419template<> struct __cxx_is_always_lock_free<unsigned char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
1420#ifndef _LIBCPP_HAS_NO_CHAR8_T
1421template<> struct __cxx_is_always_lock_free<char8_t> { enum { __value = 2 == ATOMIC_CHAR8_T_LOCK_FREE }; };
1422#endif
1423template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; };
1424template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; };
1425#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
1426template<> struct __cxx_is_always_lock_free<wchar_t> { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; };
1427#endif
1428template<> struct __cxx_is_always_lock_free<short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; };
1429template<> struct __cxx_is_always_lock_free<unsigned short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; };
1430template<> struct __cxx_is_always_lock_free<int> { enum { __value = 2 == ATOMIC_INT_LOCK_FREE }; };
1431template<> struct __cxx_is_always_lock_free<unsigned int> { enum { __value = 2 == ATOMIC_INT_LOCK_FREE }; };
1432template<> struct __cxx_is_always_lock_free<long> { enum { __value = 2 == ATOMIC_LONG_LOCK_FREE }; };
1433template<> struct __cxx_is_always_lock_free<unsigned long> { enum { __value = 2 == ATOMIC_LONG_LOCK_FREE }; };
1434template<> struct __cxx_is_always_lock_free<long long> { enum { __value = 2 == ATOMIC_LLONG_LOCK_FREE }; };
1435template<> struct __cxx_is_always_lock_free<unsigned long long> { enum { __value = 2 == ATOMIC_LLONG_LOCK_FREE }; };
1436template<typename _Tp> struct __cxx_is_always_lock_free<_Tp*> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
1437template<> struct __cxx_is_always_lock_free<std::nullptr_t> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
1438
1439#endif //__cpp_lib_atomic_is_always_lock_free
1440
14411413template <typename _Tp,
1442 typename _Base = typename conditional<__cxx_is_always_lock_free<_Tp>::__value,
1414 typename _Base = typename conditional<__libcpp_is_always_lock_free<_Tp>::__value,
14431415 __cxx_atomic_base_impl<_Tp>,
14441416 __cxx_atomic_lock_impl<_Tp> >::type>
14451417#else
......@@ -1561,7 +1533,7 @@ struct __atomic_base // false
15611533 mutable __cxx_atomic_impl<_Tp> __a_;
15621534
15631535#if defined(__cpp_lib_atomic_is_always_lock_free)
1564 static _LIBCPP_CONSTEXPR bool is_always_lock_free = __atomic_always_lock_free(sizeof(__a_), 0);
1536 static _LIBCPP_CONSTEXPR bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
15651537#endif
15661538
15671539 _LIBCPP_INLINE_VISIBILITY
......@@ -2664,7 +2636,7 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
26642636// atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type
26652637
26662638#ifdef __cpp_lib_atomic_is_always_lock_free
2667# define _LIBCPP_CONTENTION_LOCK_FREE __atomic_always_lock_free(sizeof(__cxx_contention_t), 0)
2639# define _LIBCPP_CONTENTION_LOCK_FREE ::std::__libcpp_is_always_lock_free<__cxx_contention_t>::__value
26682640#else
26692641# define _LIBCPP_CONTENTION_LOCK_FREE false
26702642#endif
lib/libcxx/include/regex+1-1
......@@ -1355,7 +1355,7 @@ inline _LIBCPP_INLINE_VISIBILITY
13551355unsigned char __to_lower(unsigned char __c)
13561356{
13571357#if defined(__MVS__) && !defined(__NATIVE_ASCII_F)
1358 return c & 0xBF;
1358 return __c & 0xBF;
13591359#else
13601360 return __c | 0x20;
13611361#endif
lib/libcxx/include/stdatomic.h+2-2
......@@ -121,7 +121,7 @@ using std::atomic_signal_fence // see below
121121# pragma GCC system_header
122122#endif
123123
124#if _LIBCPP_STD_VER > 20
124#if defined(__cplusplus) && _LIBCPP_STD_VER > 20
125125
126126#include <atomic>
127127#include <version>
......@@ -230,6 +230,6 @@ using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
230230# include_next <stdatomic.h>
231231# endif
232232
233#endif // _LIBCPP_STD_VER > 20
233#endif // defined(__cplusplus) && _LIBCPP_STD_VER > 20
234234
235235#endif // _LIBCPP_STDATOMIC_H
lib/libcxx/include/version+1-1
......@@ -332,7 +332,7 @@ __cpp_lib_void_t 201411L <type_traits>
332332# undef __cpp_lib_execution
333333// # define __cpp_lib_execution 201902L
334334# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
335# define __cpp_lib_format 202106L
335// # define __cpp_lib_format 202106L
336336# endif
337337# define __cpp_lib_generic_unordered_lookup 201811L
338338# define __cpp_lib_int_pow2 202002L