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 @@...@@ -20,9 +20,21 @@
20# pragma GCC system_header20# pragma GCC system_header
21#endif21#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
23#ifdef __cplusplus35#ifdef __cplusplus
2436
25# define _LIBCPP_VERSION 1500037# define _LIBCPP_VERSION 15003
2638
27# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y39# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
28# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)40# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
...@@ -196,18 +208,6 @@...@@ -196,18 +208,6 @@
196# define __has_include(...) 0208# define __has_include(...) 0
197# endif209# 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
211# if !defined(_LIBCPP_COMPILER_CLANG_BASED) && __cplusplus < 201103L211# if !defined(_LIBCPP_COMPILER_CLANG_BASED) && __cplusplus < 201103L
212# error "libc++ only supports C++03 with Clang-based compilers. Please enable C++11"212# error "libc++ only supports C++03 with Clang-based compilers. Please enable C++11"
213# endif213# endif
...@@ -1099,6 +1099,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD...@@ -1099,6 +1099,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
1099# define _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION1099# define _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
1100# endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES1100# 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
1102# if defined(_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES)1109# if defined(_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES)
1103# define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS1110# define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
1104# define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION1111# 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...)>...@@ -883,7 +883,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
883#endif // _LIBCPP_NO_RTTI883#endif // _LIBCPP_NO_RTTI
884};884};
885885
886#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)886#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME)
887887
888extern "C" void *_Block_copy(const void *);888extern "C" void *_Block_copy(const void *);
889extern "C" void _Block_release(const void *);889extern "C" void _Block_release(const void *);
...@@ -898,14 +898,22 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>...@@ -898,14 +898,22 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
898public:898public:
899 _LIBCPP_INLINE_VISIBILITY899 _LIBCPP_INLINE_VISIBILITY
900 explicit __func(__block_type const& __f)900 explicit __func(__block_type const& __f)
901#ifdef _LIBCPP_HAS_OBJC_ARC
902 : __f_(__f)
903#else
901 : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))904 : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
905#endif
902 { }906 { }
903907
904 // [TODO] add && to save on a retain908 // [TODO] add && to save on a retain
905909
906 _LIBCPP_INLINE_VISIBILITY910 _LIBCPP_INLINE_VISIBILITY
907 explicit __func(__block_type __f, const _Alloc& /* unused */)911 explicit __func(__block_type __f, const _Alloc& /* unused */)
912#ifdef _LIBCPP_HAS_OBJC_ARC
913 : __f_(__f)
914#else
908 : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))915 : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
916#endif
909 { }917 { }
910918
911 virtual __base<_Rp(_ArgTypes...)>* __clone() const {919 virtual __base<_Rp(_ArgTypes...)>* __clone() const {
...@@ -921,8 +929,10 @@ public:...@@ -921,8 +929,10 @@ public:
921 }929 }
922930
923 virtual void destroy() _NOEXCEPT {931 virtual void destroy() _NOEXCEPT {
932#ifndef _LIBCPP_HAS_OBJC_ARC
924 if (__f_)933 if (__f_)
925 _Block_release(__f_);934 _Block_release(__f_);
935#endif
926 __f_ = 0;936 __f_ = 0;
927 }937 }
928938
...@@ -950,7 +960,7 @@ public:...@@ -950,7 +960,7 @@ public:
950#endif // _LIBCPP_NO_RTTI960#endif // _LIBCPP_NO_RTTI
951};961};
952962
953#endif // _LIBCPP_HAS_EXTENSION_BLOCKS && !_LIBCPP_HAS_OBJC_ARC963#endif // _LIBCPP_HAS_EXTENSION_BLOCKS
954964
955} // namespace __function965} // namespace __function
956966
lib/libcxx/include/atomic+9-37
...@@ -1113,6 +1113,12 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT...@@ -1113,6 +1113,12 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
1113# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE1113# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
1114#endif1114#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
1116#ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS1122#ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
11171123
1118template<typename _Tp>1124template<typename _Tp>
...@@ -1404,42 +1410,8 @@ _Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a,...@@ -1404,42 +1410,8 @@ _Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a,
1404 return __old;1410 return __old;
1405}1411}
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
1441template <typename _Tp,1413template <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,
1443 __cxx_atomic_base_impl<_Tp>,1415 __cxx_atomic_base_impl<_Tp>,
1444 __cxx_atomic_lock_impl<_Tp> >::type>1416 __cxx_atomic_lock_impl<_Tp> >::type>
1445#else1417#else
...@@ -1561,7 +1533,7 @@ struct __atomic_base // false...@@ -1561,7 +1533,7 @@ struct __atomic_base // false
1561 mutable __cxx_atomic_impl<_Tp> __a_;1533 mutable __cxx_atomic_impl<_Tp> __a_;
15621534
1563#if defined(__cpp_lib_atomic_is_always_lock_free)1535#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;
1565#endif1537#endif
15661538
1567 _LIBCPP_INLINE_VISIBILITY1539 _LIBCPP_INLINE_VISIBILITY
...@@ -2664,7 +2636,7 @@ typedef atomic<uintmax_t> atomic_uintmax_t;...@@ -2664,7 +2636,7 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
2664// atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type2636// atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type
26652637
2666#ifdef __cpp_lib_atomic_is_always_lock_free2638#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
2668#else2640#else
2669# define _LIBCPP_CONTENTION_LOCK_FREE false2641# define _LIBCPP_CONTENTION_LOCK_FREE false
2670#endif2642#endif
lib/libcxx/include/regex+1-1
...@@ -1355,7 +1355,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -1355,7 +1355,7 @@ inline _LIBCPP_INLINE_VISIBILITY
1355unsigned char __to_lower(unsigned char __c)1355unsigned char __to_lower(unsigned char __c)
1356{1356{
1357#if defined(__MVS__) && !defined(__NATIVE_ASCII_F)1357#if defined(__MVS__) && !defined(__NATIVE_ASCII_F)
1358 return c & 0xBF;1358 return __c & 0xBF;
1359#else1359#else
1360 return __c | 0x20;1360 return __c | 0x20;
1361#endif1361#endif
lib/libcxx/include/stdatomic.h+2-2
...@@ -121,7 +121,7 @@ using std::atomic_signal_fence // see below...@@ -121,7 +121,7 @@ using std::atomic_signal_fence // see below
121# pragma GCC system_header121# pragma GCC system_header
122#endif122#endif
123123
124#if _LIBCPP_STD_VER > 20124#if defined(__cplusplus) && _LIBCPP_STD_VER > 20
125125
126#include <atomic>126#include <atomic>
127#include <version>127#include <version>
...@@ -230,6 +230,6 @@ using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;...@@ -230,6 +230,6 @@ using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
230# include_next <stdatomic.h>230# include_next <stdatomic.h>
231# endif231# endif
232232
233#endif // _LIBCPP_STD_VER > 20233#endif // defined(__cplusplus) && _LIBCPP_STD_VER > 20
234234
235#endif // _LIBCPP_STDATOMIC_H235#endif // _LIBCPP_STDATOMIC_H
lib/libcxx/include/version+1-1
...@@ -332,7 +332,7 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -332,7 +332,7 @@ __cpp_lib_void_t 201411L <type_traits>
332# undef __cpp_lib_execution332# undef __cpp_lib_execution
333// # define __cpp_lib_execution 201902L333// # define __cpp_lib_execution 201902L
334# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)334# if !defined(_LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
335# define __cpp_lib_format 202106L335// # define __cpp_lib_format 202106L
336# endif336# endif
337# define __cpp_lib_generic_unordered_lookup 201811L337# define __cpp_lib_generic_unordered_lookup 201811L
338# define __cpp_lib_int_pow2 202002L338# define __cpp_lib_int_pow2 202002L