@@ -62,7 +62,7 @@ enum { __block_size = sizeof(uint64_t) * 8 };
6262
6363// Ensures that __c(*__x, *__y) is true by swapping *__x and *__y if necessary.
6464template <class _Compare , class _RandomAccessIterator >
65- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
65+ inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
6666__cond_swap (_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c) {
6767 // Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
6868 using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
@@ -76,7 +76,7 @@ __cond_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c)
7676// Ensures that *__x, *__y and *__z are ordered according to the comparator __c,
7777// under the assumption that *__y and *__z are already ordered.
7878template <class _Compare , class _RandomAccessIterator >
79- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
79+ inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
8080__partially_sorted_swap (_RandomAccessIterator __x, _RandomAccessIterator __y, _RandomAccessIterator __z, _Compare __c) {
8181 // Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
8282 using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
@@ -95,7 +95,7 @@ template <class,
9595 class _Compare ,
9696 class _RandomAccessIterator ,
9797 __enable_if_t <__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
98- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
98+ inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
9999__sort3 (_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3, _Compare __c) {
100100 bool __swapped1 = std::__cond_swap<_Compare>(__x2, __x3, __c);
101101 bool __swapped2 = std::__partially_sorted_swap<_Compare>(__x1, __x2, __x3, __c);
@@ -106,7 +106,7 @@ template <class _AlgPolicy,
106106 class _Compare ,
107107 class _RandomAccessIterator ,
108108 __enable_if_t <!__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
109- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
109+ inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
110110__sort3 (_RandomAccessIterator __x, _RandomAccessIterator __y, _RandomAccessIterator __z, _Compare __c) {
111111 using _Ops = _IterOps<_AlgPolicy>;
112112
@@ -138,7 +138,7 @@ template <class,
138138 class _Compare ,
139139 class _RandomAccessIterator ,
140140 __enable_if_t <__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
141- inline _LIBCPP_HIDE_FROM_ABI void
141+ inline void
142142__sort4 (_RandomAccessIterator __x1,
143143 _RandomAccessIterator __x2,
144144 _RandomAccessIterator __x3,
@@ -155,7 +155,7 @@ template <class _AlgPolicy,
155155 class _Compare ,
156156 class _RandomAccessIterator ,
157157 __enable_if_t <!__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
158- inline _LIBCPP_HIDE_FROM_ABI void
158+ inline void
159159__sort4 (_RandomAccessIterator __x1,
160160 _RandomAccessIterator __x2,
161161 _RandomAccessIterator __x3,
@@ -180,7 +180,7 @@ template <class _AlgPolicy,
180180 class _Compare ,
181181 class _RandomAccessIterator ,
182182 __enable_if_t <__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
183- inline _LIBCPP_HIDE_FROM_ABI void
183+ inline void
184184__sort5 (_RandomAccessIterator __x1,
185185 _RandomAccessIterator __x2,
186186 _RandomAccessIterator __x3,
@@ -199,7 +199,7 @@ template <class _AlgPolicy,
199199 class _Compare ,
200200 class _RandomAccessIterator ,
201201 __enable_if_t <!__use_branchless_sort<_Compare, _RandomAccessIterator>, int > = 0 >
202- inline _LIBCPP_HIDE_FROM_ABI void
202+ inline void
203203__sort5 (_RandomAccessIterator __x1,
204204 _RandomAccessIterator __x2,
205205 _RandomAccessIterator __x3,
@@ -225,7 +225,7 @@ __sort5(_RandomAccessIterator __x1,
225225
226226// Assumes size > 0
227227template <class _AlgPolicy , class _Compare , class _BidirectionalIterator >
228- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
228+ _LIBCPP_CONSTEXPR_SINCE_CXX14 void
229229__selection_sort (_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) {
230230 _BidirectionalIterator __lm1 = __last;
231231 for (--__lm1; __first != __lm1; ++__first) {
@@ -238,7 +238,7 @@ __selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last,
238238// Sort the iterator range [__first, __last) using the comparator __comp using
239239// the insertion sort algorithm.
240240template <class _AlgPolicy , class _Compare , class _BidirectionalIterator >
241- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
241+ _LIBCPP_CONSTEXPR_SINCE_CXX26 void
242242__insertion_sort (_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) {
243243 using _Ops = _IterOps<_AlgPolicy>;
244244
@@ -268,8 +268,7 @@ __insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last,
268268// Assumes that there is an element in the position (__first - 1) and that each
269269// element in the input range is greater or equal to the element at __first - 1.
270270template <class _AlgPolicy , class _Compare , class _RandomAccessIterator >
271- _LIBCPP_HIDE_FROM_ABI void
272- __insertion_sort_unguarded (_RandomAccessIterator const __first, _RandomAccessIterator __last, _Compare __comp) {
271+ void __insertion_sort_unguarded (_RandomAccessIterator const __first, _RandomAccessIterator __last, _Compare __comp) {
273272 using _Ops = _IterOps<_AlgPolicy>;
274273 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
275274 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
@@ -296,8 +295,7 @@ __insertion_sort_unguarded(_RandomAccessIterator const __first, _RandomAccessIte
296295}
297296
298297template <class _AlgPolicy , class _Comp , class _RandomAccessIterator >
299- _LIBCPP_HIDE_FROM_ABI bool
300- __insertion_sort_incomplete (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
298+ bool __insertion_sort_incomplete (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
301299 using _Ops = _IterOps<_AlgPolicy>;
302300
303301 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -350,7 +348,7 @@ __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator
350348}
351349
352350template <class _AlgPolicy , class _RandomAccessIterator >
353- inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos (
351+ inline void __swap_bitmap_pos (
354352 _RandomAccessIterator __first, _RandomAccessIterator __last, uint64_t & __left_bitset, uint64_t & __right_bitset) {
355353 using _Ops = _IterOps<_AlgPolicy>;
356354 typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -368,7 +366,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos(
368366template <class _Compare ,
369367 class _RandomAccessIterator ,
370368 class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
371- inline _LIBCPP_HIDE_FROM_ABI void
369+ inline void
372370__populate_left_bitset (_RandomAccessIterator __first, _Compare __comp, _ValueType& __pivot, uint64_t & __left_bitset) {
373371 // Possible vectorization. With a proper "-march" flag, the following loop
374372 // will be compiled into a set of SIMD instructions.
@@ -384,7 +382,7 @@ __populate_left_bitset(_RandomAccessIterator __first, _Compare __comp, _ValueTyp
384382template <class _Compare ,
385383 class _RandomAccessIterator ,
386384 class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
387- inline _LIBCPP_HIDE_FROM_ABI void
385+ inline void
388386__populate_right_bitset (_RandomAccessIterator __lm1, _Compare __comp, _ValueType& __pivot, uint64_t & __right_bitset) {
389387 // Possible vectorization. With a proper "-march" flag, the following loop
390388 // will be compiled into a set of SIMD instructions.
@@ -401,7 +399,7 @@ template <class _AlgPolicy,
401399 class _Compare ,
402400 class _RandomAccessIterator ,
403401 class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
404- inline _LIBCPP_HIDE_FROM_ABI void __bitset_partition_partial_blocks (
402+ inline void __bitset_partition_partial_blocks (
405403 _RandomAccessIterator& __first,
406404 _RandomAccessIterator& __lm1,
407405 _Compare __comp,
@@ -448,7 +446,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __bitset_partition_partial_blocks(
448446}
449447
450448template <class _AlgPolicy , class _RandomAccessIterator >
451- inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos_within (
449+ inline void __swap_bitmap_pos_within (
452450 _RandomAccessIterator& __first, _RandomAccessIterator& __lm1, uint64_t & __left_bitset, uint64_t & __right_bitset) {
453451 using _Ops = _IterOps<_AlgPolicy>;
454452 typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -489,7 +487,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos_within(
489487// __bitset_partition uses bitsets for storing outcomes of the comparisons
490488// between the pivot and other elements.
491489template <class _AlgPolicy , class _RandomAccessIterator , class _Compare >
492- _LIBCPP_HIDE_FROM_ABI std::pair<_RandomAccessIterator, bool >
490+ std::pair<_RandomAccessIterator, bool >
493491__bitset_partition (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
494492 using _Ops = _IterOps<_AlgPolicy>;
495493 typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
@@ -581,7 +579,7 @@ __bitset_partition(_RandomAccessIterator __first, _RandomAccessIterator __last,
581579// the provided range is already sorted, false otherwise. We assume that the
582580// length of the range is at least three elements.
583581template <class _AlgPolicy , class _RandomAccessIterator , class _Compare >
584- _LIBCPP_HIDE_FROM_ABI std::pair<_RandomAccessIterator, bool >
582+ std::pair<_RandomAccessIterator, bool >
585583__partition_with_equals_on_right (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
586584 using _Ops = _IterOps<_AlgPolicy>;
587585 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -649,7 +647,7 @@ __partition_with_equals_on_right(_RandomAccessIterator __first, _RandomAccessIte
649647// Similar to the above function. Elements equivalent to the pivot are put to
650648// the left of the pivot. Returns the iterator to the pivot element.
651649template <class _AlgPolicy , class _RandomAccessIterator , class _Compare >
652- _LIBCPP_HIDE_FROM_ABI _RandomAccessIterator
650+ _RandomAccessIterator
653651__partition_with_equals_on_left (_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
654652 using _Ops = _IterOps<_AlgPolicy>;
655653 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -827,7 +825,7 @@ void __introsort(_RandomAccessIterator __first,
827825}
828826
829827template <typename _Number>
830- inline _LIBCPP_HIDE_FROM_ABI _Number __log2i (_Number __n) {
828+ inline _Number __log2i (_Number __n) {
831829 if (__n == 0 )
832830 return 0 ;
833831 if (sizeof (__n) <= sizeof (unsigned ))
@@ -845,6 +843,7 @@ inline _LIBCPP_HIDE_FROM_ABI _Number __log2i(_Number __n) {
845843 return __log2;
846844}
847845
846+ _LIBCPP_BEGIN_ABI_SENSITIVE
848847template <class _Comp , class _RandomAccessIterator >
849848void __sort (_RandomAccessIterator, _RandomAccessIterator, _Comp);
850849
@@ -873,9 +872,10 @@ extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<float>&, float*>(fl
873872extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<double >&, double *>(double *, double *, __less<double >&);
874873extern template _LIBCPP_EXPORTED_FROM_ABI void
875874__sort<__less<long double >&, long double *>(long double *, long double *, __less<long double >&);
875+ _LIBCPP_END_ABI_SENSITIVE
876876
877877template <class _AlgPolicy , class _RandomAccessIterator , class _Comp >
878- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
878+ _LIBCPP_CONSTEXPR_SINCE_CXX20 void
879879__sort_dispatch (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
880880 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
881881 difference_type __depth_limit = 2 * std::__log2i (__last - __first);
@@ -912,35 +912,35 @@ using __sort_is_specialized_in_library _LIBCPP_NODEBUG = __is_any_of<
912912 long double >;
913913
914914template <class _AlgPolicy , class _Type , __enable_if_t <__sort_is_specialized_in_library<_Type>::value, int > = 0 >
915- _LIBCPP_HIDE_FROM_ABI void __sort_dispatch (_Type* __first, _Type* __last, __less<>&) {
915+ void __sort_dispatch (_Type* __first, _Type* __last, __less<>&) {
916916 __less<_Type> __comp;
917917 std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
918918}
919919
920920template <class _AlgPolicy , class _Type , __enable_if_t <__sort_is_specialized_in_library<_Type>::value, int > = 0 >
921- _LIBCPP_HIDE_FROM_ABI void __sort_dispatch (_Type* __first, _Type* __last, less<_Type>&) {
921+ void __sort_dispatch (_Type* __first, _Type* __last, less<_Type>&) {
922922 __less<_Type> __comp;
923923 std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
924924}
925925
926926#if _LIBCPP_STD_VER >= 14
927927template <class _AlgPolicy , class _Type , __enable_if_t <__sort_is_specialized_in_library<_Type>::value, int > = 0 >
928- _LIBCPP_HIDE_FROM_ABI void __sort_dispatch (_Type* __first, _Type* __last, less<>&) {
928+ void __sort_dispatch (_Type* __first, _Type* __last, less<>&) {
929929 __less<_Type> __comp;
930930 std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
931931}
932932#endif
933933
934934#if _LIBCPP_STD_VER >= 20
935935template <class _AlgPolicy , class _Type , __enable_if_t <__sort_is_specialized_in_library<_Type>::value, int > = 0 >
936- _LIBCPP_HIDE_FROM_ABI void __sort_dispatch (_Type* __first, _Type* __last, ranges::less&) {
936+ void __sort_dispatch (_Type* __first, _Type* __last, ranges::less&) {
937937 __less<_Type> __comp;
938938 std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
939939}
940940#endif
941941
942942template <class _AlgPolicy , class _RandomAccessIterator , class _Comp >
943- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
943+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void
944944__sort_impl (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
945945 std::__debug_randomize_range<_AlgPolicy>(__first, __last);
946946
@@ -954,14 +954,13 @@ __sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp&
954954}
955955
956956template <class _RandomAccessIterator , class _Comp >
957- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
957+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void
958958sort (_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
959959 std::__sort_impl<_ClassicAlgPolicy>(std::move (__first), std::move (__last), __comp);
960960}
961961
962962template <class _RandomAccessIterator >
963- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
964- sort (_RandomAccessIterator __first, _RandomAccessIterator __last) {
963+ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void sort (_RandomAccessIterator __first, _RandomAccessIterator __last) {
965964 std::sort (__first, __last, __less<>());
966965}
967966
0 commit comments