Skip to content

Commit 973a718

Browse files
authored
Update libc++ / libc++abi to llvm 16 (#19515)
1 parent efff6a3 commit 973a718

File tree

798 files changed

+27452
-15441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

798 files changed

+27452
-15441
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ See docs/process.md for more on how version tagging works.
2424
address zero that is normally done when `STACK_OVERFLOW_CHECK` is enabled.
2525
(#19487)
2626
- compiler-rt updated to LLVM 16. (#19506)
27+
- libcxx and libcxxabi updated to LLVM 16. (#)
2728

2829
3.1.40 - 05/30/23
2930
-----------------

system/lib/libcxx/include/__algorithm/adjacent_find.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
_LIBCPP_BEGIN_NAMESPACE_STD
2424

2525
template <class _Iter, class _Sent, class _BinaryPredicate>
26-
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter
26+
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
2727
__adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
2828
if (__first == __last)
2929
return __first;
@@ -37,16 +37,15 @@ __adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
3737
}
3838

3939
template <class _ForwardIterator, class _BinaryPredicate>
40-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
40+
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
4141
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) {
4242
return std::__adjacent_find(std::move(__first), std::move(__last), __pred);
4343
}
4444

4545
template <class _ForwardIterator>
46-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
46+
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
4747
adjacent_find(_ForwardIterator __first, _ForwardIterator __last) {
48-
typedef typename iterator_traits<_ForwardIterator>::value_type __v;
49-
return std::adjacent_find(std::move(__first), std::move(__last), __equal_to<__v>());
48+
return std::adjacent_find(std::move(__first), std::move(__last), __equal_to());
5049
}
5150

5251
_LIBCPP_END_NAMESPACE_STD

system/lib/libcxx/include/__algorithm/all_of.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
_LIBCPP_BEGIN_NAMESPACE_STD
2020

2121
template <class _InputIterator, class _Predicate>
22-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
22+
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
2323
all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
2424
for (; __first != __last; ++__first)
2525
if (!__pred(*__first))

system/lib/libcxx/include/__algorithm/any_of.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
_LIBCPP_BEGIN_NAMESPACE_STD
2020

2121
template <class _InputIterator, class _Predicate>
22-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
22+
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
2323
any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
2424
for (; __first != __last; ++__first)
2525
if (__pred(*__first))

system/lib/libcxx/include/__algorithm/binary_search.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2323

2424
template <class _ForwardIterator, class _Tp, class _Compare>
2525
_LIBCPP_NODISCARD_EXT inline
26-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
26+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
2727
bool
2828
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
2929
{
30-
using _Comp_ref = typename __comp_ref_type<_Compare>::type;
31-
__first = std::lower_bound<_ForwardIterator, _Tp, _Comp_ref>(__first, __last, __value, __comp);
30+
__first = std::lower_bound<_ForwardIterator, _Tp, __comp_ref_type<_Compare> >(__first, __last, __value, __comp);
3231
return __first != __last && !__comp(__value, *__first);
3332
}
3433

3534
template <class _ForwardIterator, class _Tp>
3635
_LIBCPP_NODISCARD_EXT inline
37-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
36+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
3837
bool
3938
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
4039
{

system/lib/libcxx/include/__algorithm/comp.h

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,73 +17,47 @@
1717

1818
_LIBCPP_BEGIN_NAMESPACE_STD
1919

20-
// I'd like to replace these with _VSTD::equal_to<void>, but can't because:
21-
// * That only works with C++14 and later, and
22-
// * We haven't included <functional> here.
23-
template <class _T1, class _T2 = _T1>
24-
struct __equal_to
25-
{
26-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
27-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
28-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
29-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
30-
};
31-
32-
template <class _T1>
33-
struct __equal_to<_T1, _T1>
34-
{
35-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
36-
bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
37-
};
38-
39-
template <class _T1>
40-
struct __equal_to<const _T1, _T1>
41-
{
42-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
43-
bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
44-
};
45-
46-
template <class _T1>
47-
struct __equal_to<_T1, const _T1>
48-
{
49-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
50-
bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
20+
struct __equal_to {
21+
template <class _T1, class _T2>
22+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _T1& __x, const _T2& __y) const {
23+
return __x == __y;
24+
}
5125
};
5226

5327
template <class _T1, class _T2 = _T1>
5428
struct __less
5529
{
56-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
30+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
5731
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
5832

59-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
33+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
6034
bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;}
6135

62-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
36+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
6337
bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;}
6438

65-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
39+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
6640
bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;}
6741
};
6842

6943
template <class _T1>
7044
struct __less<_T1, _T1>
7145
{
72-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
46+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
7347
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
7448
};
7549

7650
template <class _T1>
7751
struct __less<const _T1, _T1>
7852
{
79-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
53+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
8054
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
8155
};
8256

8357
template <class _T1>
8458
struct __less<_T1, const _T1>
8559
{
86-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
60+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
8761
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
8862
};
8963

system/lib/libcxx/include/__algorithm/comp_ref_type.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ template <class _Compare>
2323
struct __debug_less
2424
{
2525
_Compare &__comp_;
26-
_LIBCPP_CONSTEXPR_AFTER_CXX11
26+
_LIBCPP_CONSTEXPR_SINCE_CXX14
2727
__debug_less(_Compare& __c) : __comp_(__c) {}
2828

2929
template <class _Tp, class _Up>
30-
_LIBCPP_CONSTEXPR_AFTER_CXX11
30+
_LIBCPP_CONSTEXPR_SINCE_CXX14
3131
bool operator()(const _Tp& __x, const _Up& __y)
3232
{
3333
bool __r = __comp_(__x, __y);
@@ -37,7 +37,7 @@ struct __debug_less
3737
}
3838

3939
template <class _Tp, class _Up>
40-
_LIBCPP_CONSTEXPR_AFTER_CXX11
40+
_LIBCPP_CONSTEXPR_SINCE_CXX14
4141
bool operator()(_Tp& __x, _Up& __y)
4242
{
4343
bool __r = __comp_(__x, __y);
@@ -47,10 +47,10 @@ struct __debug_less
4747
}
4848

4949
template <class _LHS, class _RHS>
50-
_LIBCPP_CONSTEXPR_AFTER_CXX11
50+
_LIBCPP_CONSTEXPR_SINCE_CXX14
5151
inline _LIBCPP_INLINE_VISIBILITY
52-
decltype((void)declval<_Compare&>()(
53-
declval<_LHS &>(), declval<_RHS &>()))
52+
decltype((void)std::declval<_Compare&>()(
53+
std::declval<_LHS &>(), std::declval<_RHS &>()))
5454
__do_compare_assert(int, _LHS & __l, _RHS & __r) {
5555
_LIBCPP_DEBUG_ASSERT(!__comp_(__l, __r),
5656
"Comparator does not induce a strict weak ordering");
@@ -59,21 +59,20 @@ struct __debug_less
5959
}
6060

6161
template <class _LHS, class _RHS>
62-
_LIBCPP_CONSTEXPR_AFTER_CXX11
62+
_LIBCPP_CONSTEXPR_SINCE_CXX14
6363
inline _LIBCPP_INLINE_VISIBILITY
6464
void __do_compare_assert(long, _LHS &, _RHS &) {}
6565
};
6666

67-
template <class _Comp>
68-
struct __comp_ref_type {
69-
// Pass the comparator by lvalue reference. Or in debug mode, using a
70-
// debugging wrapper that stores a reference.
67+
// Pass the comparator by lvalue reference. Or in debug mode, using a
68+
// debugging wrapper that stores a reference.
7169
#ifdef _LIBCPP_ENABLE_DEBUG_MODE
72-
typedef __debug_less<_Comp> type;
70+
template <class _Comp>
71+
using __comp_ref_type = __debug_less<_Comp>;
7372
#else
74-
typedef _Comp& type;
73+
template <class _Comp>
74+
using __comp_ref_type = _Comp&;
7575
#endif
76-
};
7776

7877
_LIBCPP_END_NAMESPACE_STD
7978

0 commit comments

Comments
 (0)