Skip to content

Commit cdbf682

Browse files
committed
Update libcxx and libcxxabi to LLVM 19.1.4
1 parent b3edd4c commit cdbf682

File tree

613 files changed

+9584
-19453
lines changed

Some content is hidden

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

613 files changed

+9584
-19453
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _LIBCPP_PUSH_MACROS
2626
_LIBCPP_BEGIN_NAMESPACE_STD
2727

2828
template <class _Iter, class _Sent, class _BinaryPredicate>
29-
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
29+
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
3030
__adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
3131
if (__first == __last)
3232
return __first;
@@ -40,13 +40,13 @@ __adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
4040
}
4141

4242
template <class _ForwardIterator, class _BinaryPredicate>
43-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
43+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
4444
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) {
4545
return std::__adjacent_find(std::move(__first), std::move(__last), __pred);
4646
}
4747

4848
template <class _ForwardIterator>
49-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
49+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
5050
adjacent_find(_ForwardIterator __first, _ForwardIterator __last) {
5151
return std::adjacent_find(std::move(__first), std::move(__last), __equal_to());
5252
}

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_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
22+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _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_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
22+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
_LIBCPP_BEGIN_NAMESPACE_STD
2323

2424
template <class _ForwardIterator, class _Tp, class _Compare>
25-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
25+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
2626
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
2727
__first = std::lower_bound<_ForwardIterator, _Tp, __comp_ref_type<_Compare> >(__first, __last, __value, __comp);
2828
return __first != __last && !__comp(__value, *__first);
2929
}
3030

3131
template <class _ForwardIterator, class _Tp>
32-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
32+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
3333
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
3434
return std::binary_search(__first, __last, __value, __less<>());
3535
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
#if _LIBCPP_STD_VER >= 17
2323
template <class _Tp, class _Compare>
24-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
24+
[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
2525
clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
2626
_LIBCPP_LIFETIMEBOUND const _Tp& __lo,
2727
_LIBCPP_LIFETIMEBOUND const _Tp& __hi,
@@ -31,7 +31,7 @@ clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
3131
}
3232

3333
template <class _Tp>
34-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
34+
[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
3535
clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
3636
_LIBCPP_LIFETIMEBOUND const _Tp& __lo,
3737
_LIBCPP_LIFETIMEBOUND const _Tp& __hi) {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#define _LIBCPP___ALGORITHM_COMP_H
1111

1212
#include <__config>
13-
#include <__type_traits/integral_constant.h>
14-
#include <__type_traits/operation_traits.h>
13+
#include <__type_traits/desugars_to.h>
1514

1615
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1716
# pragma GCC system_header
@@ -27,7 +26,7 @@ struct __equal_to {
2726
};
2827

2928
template <class _Tp, class _Up>
30-
struct __desugars_to<__equal_tag, __equal_to, _Tp, _Up> : true_type {};
29+
inline const bool __desugars_to_v<__equal_tag, __equal_to, _Tp, _Up> = true;
3130

3231
// The definition is required because __less is part of the ABI, but it's empty
3332
// because all comparisons should be transparent.
@@ -42,6 +41,9 @@ struct __less<void, void> {
4241
}
4342
};
4443

44+
template <class _Tp>
45+
inline const bool __desugars_to_v<__less_tag, __less<>, _Tp, _Tp> = true;
46+
4547
_LIBCPP_END_NAMESPACE_STD
4648

4749
#endif // _LIBCPP___ALGORITHM_COMP_H

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ struct __debug_less {
4141
}
4242

4343
template <class _LHS, class _RHS>
44-
_LIBCPP_CONSTEXPR_SINCE_CXX14 inline _LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(
45-
std::declval<_LHS&>(), std::declval<_RHS&>()))
46-
__do_compare_assert(int, _LHS& __l, _RHS& __r) {
44+
_LIBCPP_CONSTEXPR_SINCE_CXX14 inline
45+
_LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(std::declval<_LHS&>(), std::declval<_RHS&>()))
46+
__do_compare_assert(int, _LHS& __l, _RHS& __r) {
4747
_LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(!__comp_(__l, __r), "Comparator does not induce a strict weak ordering");
4848
(void)__l;
4949
(void)__r;

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ template <class, class _InIter, class _Sent, class _OutIter>
3232
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter> __copy(_InIter, _Sent, _OutIter);
3333

3434
template <class _AlgPolicy>
35-
struct __copy_loop {
35+
struct __copy_impl {
3636
template <class _InIter, class _Sent, class _OutIter>
3737
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
3838
operator()(_InIter __first, _Sent __last, _OutIter __result) const {
@@ -94,9 +94,7 @@ struct __copy_loop {
9494
__local_first = _Traits::__begin(++__segment_iterator);
9595
}
9696
}
97-
};
9897

99-
struct __copy_trivial {
10098
// At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
10199
template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>
102100
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>
@@ -108,7 +106,7 @@ struct __copy_trivial {
108106
template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>
109107
pair<_InIter, _OutIter> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
110108
__copy(_InIter __first, _Sent __last, _OutIter __result) {
111-
return std::__dispatch_copy_or_move<_AlgPolicy, __copy_loop<_AlgPolicy>, __copy_trivial>(
109+
return std::__copy_move_unwrap_iters<__copy_impl<_AlgPolicy> >(
112110
std::move(__first), std::move(__last), std::move(__result));
113111
}
114112

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <__config>
1616
#include <__iterator/segmented_iterator.h>
1717
#include <__type_traits/common_type.h>
18-
#include <__type_traits/is_copy_constructible.h>
18+
#include <__type_traits/is_constructible.h>
1919
#include <__utility/move.h>
2020
#include <__utility/pair.h>
2121

@@ -33,7 +33,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InIter, _OutIter>
3333
__copy_backward(_InIter __first, _Sent __last, _OutIter __result);
3434

3535
template <class _AlgPolicy>
36-
struct __copy_backward_loop {
36+
struct __copy_backward_impl {
3737
template <class _InIter, class _Sent, class _OutIter>
3838
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
3939
operator()(_InIter __first, _Sent __last, _OutIter __result) const {
@@ -104,9 +104,7 @@ struct __copy_backward_loop {
104104
__local_last = _Traits::__end(__segment_iterator);
105105
}
106106
}
107-
};
108107

109-
struct __copy_backward_trivial {
110108
// At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
111109
template <class _In, class _Out, __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>
112110
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_In*, _Out*>
@@ -118,7 +116,7 @@ struct __copy_backward_trivial {
118116
template <class _AlgPolicy, class _BidirectionalIterator1, class _Sentinel, class _BidirectionalIterator2>
119117
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_BidirectionalIterator1, _BidirectionalIterator2>
120118
__copy_backward(_BidirectionalIterator1 __first, _Sentinel __last, _BidirectionalIterator2 __result) {
121-
return std::__dispatch_copy_or_move<_AlgPolicy, __copy_backward_loop<_AlgPolicy>, __copy_backward_trivial>(
119+
return std::__copy_move_unwrap_iters<__copy_backward_impl<_AlgPolicy> >(
122120
std::move(__first), std::move(__last), std::move(__result));
123121
}
124122

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

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
#include <__type_traits/enable_if.h>
2020
#include <__type_traits/is_always_bitcastable.h>
2121
#include <__type_traits/is_constant_evaluated.h>
22-
#include <__type_traits/is_copy_constructible.h>
22+
#include <__type_traits/is_constructible.h>
2323
#include <__type_traits/is_trivially_assignable.h>
24-
#include <__type_traits/is_trivially_copyable.h>
2524
#include <__type_traits/is_volatile.h>
2625
#include <__utility/move.h>
2726
#include <__utility/pair.h>
@@ -81,30 +80,17 @@ __copy_backward_trivial_impl(_In* __first, _In* __last, _Out* __result) {
8180

8281
// Iterator unwrapping and dispatching to the correct overload.
8382

84-
template <class _F1, class _F2>
85-
struct __overload : _F1, _F2 {
86-
using _F1::operator();
87-
using _F2::operator();
88-
};
89-
90-
template <class _InIter, class _Sent, class _OutIter, class = void>
91-
struct __can_rewrap : false_type {};
92-
93-
template <class _InIter, class _Sent, class _OutIter>
94-
struct __can_rewrap<_InIter,
95-
_Sent,
96-
_OutIter,
97-
// Note that sentinels are always copy-constructible.
98-
__enable_if_t< is_copy_constructible<_InIter>::value && is_copy_constructible<_OutIter>::value > >
99-
: true_type {};
83+
template <class _InIter, class _OutIter>
84+
struct __can_rewrap
85+
: integral_constant<bool, is_copy_constructible<_InIter>::value && is_copy_constructible<_OutIter>::value> {};
10086

10187
template <class _Algorithm,
10288
class _InIter,
10389
class _Sent,
10490
class _OutIter,
105-
__enable_if_t<__can_rewrap<_InIter, _Sent, _OutIter>::value, int> = 0>
91+
__enable_if_t<__can_rewrap<_InIter, _OutIter>::value, int> = 0>
10692
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>
107-
__unwrap_and_dispatch(_InIter __first, _Sent __last, _OutIter __out_first) {
93+
__copy_move_unwrap_iters(_InIter __first, _Sent __last, _OutIter __out_first) {
10894
auto __range = std::__unwrap_range(__first, std::move(__last));
10995
auto __result = _Algorithm()(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__out_first));
11096
return std::make_pair(std::__rewrap_range<_Sent>(std::move(__first), std::move(__result.first)),
@@ -115,24 +101,12 @@ template <class _Algorithm,
115101
class _InIter,
116102
class _Sent,
117103
class _OutIter,
118-
__enable_if_t<!__can_rewrap<_InIter, _Sent, _OutIter>::value, int> = 0>
104+
__enable_if_t<!__can_rewrap<_InIter, _OutIter>::value, int> = 0>
119105
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>
120-
__unwrap_and_dispatch(_InIter __first, _Sent __last, _OutIter __out_first) {
106+
__copy_move_unwrap_iters(_InIter __first, _Sent __last, _OutIter __out_first) {
121107
return _Algorithm()(std::move(__first), std::move(__last), std::move(__out_first));
122108
}
123109

124-
template <class _AlgPolicy,
125-
class _NaiveAlgorithm,
126-
class _OptimizedAlgorithm,
127-
class _InIter,
128-
class _Sent,
129-
class _OutIter>
130-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>
131-
__dispatch_copy_or_move(_InIter __first, _Sent __last, _OutIter __out_first) {
132-
using _Algorithm = __overload<_NaiveAlgorithm, _OptimizedAlgorithm>;
133-
return std::__unwrap_and_dispatch<_Algorithm>(std::move(__first), std::move(__last), std::move(__out_first));
134-
}
135-
136110
_LIBCPP_END_NAMESPACE_STD
137111

138112
_LIBCPP_POP_MACROS

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ __count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __l
7979
}
8080

8181
template <class _InputIterator, class _Tp>
82-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iter_diff_t<_InputIterator>
82+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iter_diff_t<_InputIterator>
8383
count(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
8484
__identity __proj;
8585
return std::__count<_ClassicAlgPolicy>(__first, __last, __value, __proj);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
_LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
template <class _InputIterator, class _Predicate>
23-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
24-
typename iterator_traits<_InputIterator>::difference_type
25-
count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
23+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
24+
typename iterator_traits<_InputIterator>::difference_type
25+
count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
2626
typename iterator_traits<_InputIterator>::difference_type __r(0);
2727
for (; __first != __last; ++__first)
2828
if (__pred(*__first))

0 commit comments

Comments
 (0)