@@ -64,7 +64,7 @@ enum { __block_size = sizeof(uint64_t) * 8 };
64
64
65
65
// Ensures that __c(*__x, *__y) is true by swapping *__x and *__y if necessary.
66
66
template <class _Compare , class _RandomAccessIterator >
67
- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
67
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
68
68
__cond_swap (_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c) {
69
69
// Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
70
70
using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
@@ -78,7 +78,7 @@ __cond_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c)
78
78
// Ensures that *__x, *__y and *__z are ordered according to the comparator __c,
79
79
// under the assumption that *__y and *__z are already ordered.
80
80
template <class _Compare , class _RandomAccessIterator >
81
- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
81
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
82
82
__partially_sorted_swap (_RandomAccessIterator __x, _RandomAccessIterator __y, _RandomAccessIterator __z, _Compare __c) {
83
83
// Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
84
84
using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
@@ -97,7 +97,7 @@ template <class,
97
97
class _Compare ,
98
98
class _RandomAccessIterator ,
99
99
__enable_if_t <__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
100
- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
100
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
101
101
__sort3 (_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3, _Compare __c) {
102
102
bool __swapped1 = std::__cond_swap<_Compare>(__x2, __x3, __c);
103
103
bool __swapped2 = std::__partially_sorted_swap<_Compare>(__x1, __x2, __x3, __c);
@@ -108,7 +108,7 @@ template <class _AlgPolicy,
108
108
class _Compare ,
109
109
class _RandomAccessIterator ,
110
110
__enable_if_t <!__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
111
- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
111
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
112
112
__sort3 (_RandomAccessIterator __x, _RandomAccessIterator __y, _RandomAccessIterator __z, _Compare __c) {
113
113
using _Ops = _IterOps<_AlgPolicy>;
114
114
@@ -140,7 +140,7 @@ template <class,
140
140
class _Compare ,
141
141
class _RandomAccessIterator ,
142
142
__enable_if_t <__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
143
- inline _LIBCPP_HIDE_FROM_ABI void
143
+ inline void
144
144
__sort4 (_RandomAccessIterator __x1,
145
145
_RandomAccessIterator __x2,
146
146
_RandomAccessIterator __x3,
@@ -157,7 +157,7 @@ template <class _AlgPolicy,
157
157
class _Compare ,
158
158
class _RandomAccessIterator ,
159
159
__enable_if_t <!__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
160
- inline _LIBCPP_HIDE_FROM_ABI void
160
+ inline void
161
161
__sort4 (_RandomAccessIterator __x1,
162
162
_RandomAccessIterator __x2,
163
163
_RandomAccessIterator __x3,
@@ -182,7 +182,7 @@ template <class _AlgPolicy,
182
182
class _Compare ,
183
183
class _RandomAccessIterator ,
184
184
__enable_if_t <__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
185
- inline _LIBCPP_HIDE_FROM_ABI void
185
+ inline void
186
186
__sort5 (_RandomAccessIterator __x1,
187
187
_RandomAccessIterator __x2,
188
188
_RandomAccessIterator __x3,
@@ -201,7 +201,7 @@ template <class _AlgPolicy,
201
201
class _Compare ,
202
202
class _RandomAccessIterator ,
203
203
__enable_if_t <!__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
204
- inline _LIBCPP_HIDE_FROM_ABI void
204
+ inline void
205
205
__sort5 (_RandomAccessIterator __x1,
206
206
_RandomAccessIterator __x2,
207
207
_RandomAccessIterator __x3,
@@ -227,7 +227,7 @@ __sort5(_RandomAccessIterator __x1,
227
227
228
228
// Assumes size > 0
229
229
template <class _AlgPolicy , class _Compare , class _BidirectionalIterator >
230
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
230
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 void
231
231
__selection_sort (_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) {
232
232
_BidirectionalIterator __lm1 = __last;
233
233
for (--__lm1; __first != __lm1; ++__first) {
@@ -240,7 +240,7 @@ __selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last,
240
240
// Sort the iterator range [__first, __last) using the comparator __comp using
241
241
// the insertion sort algorithm.
242
242
template <class _AlgPolicy , class _Compare , class _BidirectionalIterator >
243
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
243
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 void
244
244
__insertion_sort (_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) {
245
245
using _Ops = _IterOps<_AlgPolicy>;
246
246
@@ -270,8 +270,7 @@ __insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last,
270
270
// Assumes that there is an element in the position (__first - 1) and that each
271
271
// element in the input range is greater or equal to the element at __first - 1.
272
272
template <class _AlgPolicy , class _Compare , class _RandomAccessIterator >
273
- _LIBCPP_HIDE_FROM_ABI void
274
- __insertion_sort_unguarded (_RandomAccessIterator const __first, _RandomAccessIterator __last, _Compare __comp) {
273
+ void __insertion_sort_unguarded (_RandomAccessIterator const __first, _RandomAccessIterator __last, _Compare __comp) {
275
274
using _Ops = _IterOps<_AlgPolicy>;
276
275
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
277
276
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
@@ -298,8 +297,7 @@ __insertion_sort_unguarded(_RandomAccessIterator const __first, _RandomAccessIte
298
297
}
299
298
300
299
template <class _AlgPolicy , class _Comp , class _RandomAccessIterator >
301
- _LIBCPP_HIDE_FROM_ABI bool
302
- __insertion_sort_incomplete (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
300
+ bool __insertion_sort_incomplete (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
303
301
using _Ops = _IterOps<_AlgPolicy>;
304
302
305
303
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -352,7 +350,7 @@ __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator
352
350
}
353
351
354
352
template <class _AlgPolicy , class _RandomAccessIterator >
355
- inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos (
353
+ inline void __swap_bitmap_pos (
356
354
_RandomAccessIterator __first, _RandomAccessIterator __last, uint64_t & __left_bitset, uint64_t & __right_bitset) {
357
355
using _Ops = _IterOps<_AlgPolicy>;
358
356
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -370,7 +368,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos(
370
368
template <class _Compare ,
371
369
class _RandomAccessIterator ,
372
370
class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
373
- inline _LIBCPP_HIDE_FROM_ABI void
371
+ inline void
374
372
__populate_left_bitset (_RandomAccessIterator __first, _Compare __comp, _ValueType& __pivot, uint64_t & __left_bitset) {
375
373
// Possible vectorization. With a proper "-march" flag, the following loop
376
374
// will be compiled into a set of SIMD instructions.
@@ -386,7 +384,7 @@ __populate_left_bitset(_RandomAccessIterator __first, _Compare __comp, _ValueTyp
386
384
template <class _Compare ,
387
385
class _RandomAccessIterator ,
388
386
class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
389
- inline _LIBCPP_HIDE_FROM_ABI void
387
+ inline void
390
388
__populate_right_bitset (_RandomAccessIterator __lm1, _Compare __comp, _ValueType& __pivot, uint64_t & __right_bitset) {
391
389
// Possible vectorization. With a proper "-march" flag, the following loop
392
390
// will be compiled into a set of SIMD instructions.
@@ -403,7 +401,7 @@ template <class _AlgPolicy,
403
401
class _Compare ,
404
402
class _RandomAccessIterator ,
405
403
class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
406
- inline _LIBCPP_HIDE_FROM_ABI void __bitset_partition_partial_blocks (
404
+ inline void __bitset_partition_partial_blocks (
407
405
_RandomAccessIterator& __first,
408
406
_RandomAccessIterator& __lm1,
409
407
_Compare __comp,
@@ -450,7 +448,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __bitset_partition_partial_blocks(
450
448
}
451
449
452
450
template <class _AlgPolicy , class _RandomAccessIterator >
453
- inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos_within (
451
+ inline void __swap_bitmap_pos_within (
454
452
_RandomAccessIterator& __first, _RandomAccessIterator& __lm1, uint64_t & __left_bitset, uint64_t & __right_bitset) {
455
453
using _Ops = _IterOps<_AlgPolicy>;
456
454
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -491,7 +489,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos_within(
491
489
// __bitset_partition uses bitsets for storing outcomes of the comparisons
492
490
// between the pivot and other elements.
493
491
template <class _AlgPolicy , class _RandomAccessIterator , class _Compare >
494
- _LIBCPP_HIDE_FROM_ABI std::pair<_RandomAccessIterator, bool >
492
+ std::pair<_RandomAccessIterator, bool >
495
493
__bitset_partition (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
496
494
using _Ops = _IterOps<_AlgPolicy>;
497
495
typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
@@ -583,7 +581,7 @@ __bitset_partition(_RandomAccessIterator __first, _RandomAccessIterator __last,
583
581
// the provided range is already sorted, false otherwise. We assume that the
584
582
// length of the range is at least three elements.
585
583
template <class _AlgPolicy , class _RandomAccessIterator , class _Compare >
586
- _LIBCPP_HIDE_FROM_ABI std::pair<_RandomAccessIterator, bool >
584
+ std::pair<_RandomAccessIterator, bool >
587
585
__partition_with_equals_on_right (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
588
586
using _Ops = _IterOps<_AlgPolicy>;
589
587
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -651,7 +649,7 @@ __partition_with_equals_on_right(_RandomAccessIterator __first, _RandomAccessIte
651
649
// Similar to the above function. Elements equivalent to the pivot are put to
652
650
// the left of the pivot. Returns the iterator to the pivot element.
653
651
template <class _AlgPolicy , class _RandomAccessIterator , class _Compare >
654
- _LIBCPP_HIDE_FROM_ABI _RandomAccessIterator
652
+ _RandomAccessIterator
655
653
__partition_with_equals_on_left (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
656
654
using _Ops = _IterOps<_AlgPolicy>;
657
655
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -828,6 +826,7 @@ void __introsort(_RandomAccessIterator __first,
828
826
}
829
827
}
830
828
829
+ _LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
831
830
template <class _Comp , class _RandomAccessIterator >
832
831
void __sort (_RandomAccessIterator, _RandomAccessIterator, _Comp);
833
832
@@ -856,9 +855,10 @@ extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<float>&, float*>(fl
856
855
extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<double >&, double *>(double *, double *, __less<double >&);
857
856
extern template _LIBCPP_EXPORTED_FROM_ABI void
858
857
__sort<__less<long double >&, long double *>(long double *, long double *, __less<long double >&);
858
+ _LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
859
859
860
860
template <class _AlgPolicy , class _RandomAccessIterator , class _Comp >
861
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
861
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 void
862
862
__sort_dispatch (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
863
863
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
864
864
difference_type __depth_limit = 2 * std::__bit_log2 (std::__to_unsigned_like (__last - __first));
@@ -895,35 +895,35 @@ using __sort_is_specialized_in_library _LIBCPP_NODEBUG = __is_any_of<
895
895
long double >;
896
896
897
897
template <class _AlgPolicy , class _Type , __enable_if_t <__sort_is_specialized_in_library<_Type>::value, int > = 0 >
898
- _LIBCPP_HIDE_FROM_ABI void __sort_dispatch (_Type* __first, _Type* __last, __less<>&) {
898
+ void __sort_dispatch (_Type* __first, _Type* __last, __less<>&) {
899
899
__less<_Type> __comp;
900
900
std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
901
901
}
902
902
903
903
template <class _AlgPolicy , class _Type , __enable_if_t <__sort_is_specialized_in_library<_Type>::value, int > = 0 >
904
- _LIBCPP_HIDE_FROM_ABI void __sort_dispatch (_Type* __first, _Type* __last, less<_Type>&) {
904
+ void __sort_dispatch (_Type* __first, _Type* __last, less<_Type>&) {
905
905
__less<_Type> __comp;
906
906
std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
907
907
}
908
908
909
909
#if _LIBCPP_STD_VER >= 14
910
910
template <class _AlgPolicy , class _Type , __enable_if_t <__sort_is_specialized_in_library<_Type>::value, int > = 0 >
911
- _LIBCPP_HIDE_FROM_ABI void __sort_dispatch (_Type* __first, _Type* __last, less<>&) {
911
+ void __sort_dispatch (_Type* __first, _Type* __last, less<>&) {
912
912
__less<_Type> __comp;
913
913
std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
914
914
}
915
915
#endif
916
916
917
917
#if _LIBCPP_STD_VER >= 20
918
918
template <class _AlgPolicy , class _Type , __enable_if_t <__sort_is_specialized_in_library<_Type>::value, int > = 0 >
919
- _LIBCPP_HIDE_FROM_ABI void __sort_dispatch (_Type* __first, _Type* __last, ranges::less&) {
919
+ void __sort_dispatch (_Type* __first, _Type* __last, ranges::less&) {
920
920
__less<_Type> __comp;
921
921
std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
922
922
}
923
923
#endif
924
924
925
925
template <class _AlgPolicy , class _RandomAccessIterator , class _Comp >
926
- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
926
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void
927
927
__sort_impl (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
928
928
std::__debug_randomize_range<_AlgPolicy>(__first, __last);
929
929
@@ -937,14 +937,13 @@ __sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp&
937
937
}
938
938
939
939
template <class _RandomAccessIterator , class _Comp >
940
- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
940
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void
941
941
sort (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
942
942
std::__sort_impl<_ClassicAlgPolicy>(std::move (__first), std::move (__last), __comp);
943
943
}
944
944
945
945
template <class _RandomAccessIterator >
946
- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
947
- sort (_RandomAccessIterator __first, _RandomAccessIterator __last) {
946
+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void sort (_RandomAccessIterator __first, _RandomAccessIterator __last) {
948
947
std::sort (__first, __last, __less<>());
949
948
}
950
949
0 commit comments