Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libcxx and libcxxabi to LLVM 19.1.4 #22994

Merged
merged 75 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
cdbf682
Update libcxx and libcxxabi to LLVM 19.1.4
aheejin Nov 23, 2024
f619917
Add new files
aheejin Nov 23, 2024
b74dda1
Restore deleted __config_site
aheejin Nov 23, 2024
41f8037
Re-add + update __assertion_handler from default_assertion_handler.in
aheejin Nov 23, 2024
6eec95b
Restore deleted Emscripten-specific files
aheejin Nov 23, 2024
4b969c3
_LIBCPP_PSTL_CPU_BACKEND_SERIAL -> _LIBCPP_PSTL_BACKEND_SERIAL
aheejin Nov 23, 2024
8b0bfdf
Build libc++ / libc++abi with C++23
aheejin Dec 3, 2024
5bbcbf0
Exclude compiler_rt_shims.cpp
aheejin Dec 3, 2024
a5f2cbe
Disable time zone support
aheejin Dec 3, 2024
643050f
Remove basic_string<unsigned_char> from embind
aheejin Dec 4, 2024
9f291d8
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Dec 4, 2024
1fb1316
Rebaseline size tests
aheejin Dec 4, 2024
ba8abf7
Remove basic_string<unsigned_char> from embind
aheejin Dec 4, 2024
b132cff
Merge branch 'remove_basic_string_unsigned_char' into update_libcxx_l…
aheejin Dec 4, 2024
d7aa36b
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Dec 4, 2024
3ecfa95
Remove basic_string<unsigned_char> from embind
aheejin Dec 4, 2024
b34e479
rebaseline
aheejin Dec 4, 2024
6b731e2
rebaseline again
aheejin Dec 5, 2024
49bd6fb
Remove (name === "std::string")
aheejin Dec 5, 2024
b421f75
More rebaseline
aheejin Dec 5, 2024
1cdbe79
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Dec 5, 2024
6ff9f5d
Merge branch 'remove_basic_string_unsigned_char' into update_libcxx_l…
aheejin Dec 5, 2024
093c537
More code size rebaseline
aheejin Dec 5, 2024
07d8b3f
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Dec 6, 2024
d067393
Rebaseline other.test_codesize_files_wasmfs
aheejin Dec 6, 2024
a5a76c3
Fix other.test_embind_no_duplicate_symbols
aheejin Dec 6, 2024
6d1960c
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Dec 6, 2024
76a4466
Only run other.test_minimal_runtime_code_size_hello_embind
aheejin Dec 7, 2024
9bd9968
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Dec 7, 2024
d9b6376
Rebaseline test_minimal_runtime_code_size_hello_embind again?
aheejin Dec 8, 2024
b6a4e44
Revert "Only run other.test_minimal_runtime_code_size_hello_embind"
aheejin Dec 8, 2024
fe41b0e
Reapply "Only run other.test_minimal_runtime_code_size_hello_embind"
aheejin Dec 8, 2024
9049a44
Add --profiling-funcs for debugging
aheejin Dec 9, 2024
1640595
Revert "Add --profiling-funcs for debugging"
aheejin Dec 9, 2024
355370f
Revert "Reapply "Only run other.test_minimal_runtime_code_size_hello_…
aheejin Dec 9, 2024
eb033b6
Try -no-canonical-prefixes
aheejin Dec 11, 2024
3d33afc
Reapply "Reapply "Only run other.test_minimal_runtime_code_size_hello…
aheejin Dec 11, 2024
25cb496
Revert "Try -no-canonical-prefixes"
aheejin Dec 11, 2024
6f0f0f3
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Dec 12, 2024
276c638
Test logging
aheejin Dec 12, 2024
8fdada2
Revert "Reapply "Reapply "Only run other.test_minimal_runtime_code_si…
aheejin Dec 12, 2024
19ce9b4
Reapply "Reapply "Reapply "Only run other.test_minimal_runtime_code_s…
aheejin Dec 12, 2024
978ac9b
Revert "Test logging"
aheejin Dec 12, 2024
5da56b4
Use CIRCLRCI environment variable
aheejin Dec 12, 2024
0d689a3
Rebaseline size tests using CIRCLECI env var
aheejin Dec 12, 2024
8bb5d25
More test logging
aheejin Dec 12, 2024
ae3c647
Let embuilder use deterministic paths even when using Ninja
aheejin Dec 12, 2024
c48361d
Temporarily disable -ffile-prefix-map for testing
aheejin Dec 16, 2024
e1ec7f7
Disable all other tests except test-other for testing
aheejin Dec 16, 2024
118d3bf
Set EMCC_DEBUG=1
aheejin Dec 16, 2024
1fc602d
Revert "Disable all other tests except test-other for testing"
aheejin Dec 16, 2024
bcf4aae
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Dec 16, 2024
35bbd5e
Reapply "Disable all other tests except test-other for testing"
aheejin Dec 16, 2024
4105630
Make test-other not use build-libs
aheejin Dec 16, 2024
9e33f85
Unfreeze cache
aheejin Dec 16, 2024
8e99594
Revert "Unfreeze cache"
aheejin Dec 17, 2024
21503d3
Revert "Make test-other not use build-libs"
aheejin Dec 17, 2024
dc1cd98
Revert "Reapply "Disable all other tests except test-other for testing""
aheejin Dec 17, 2024
6463ba5
Revert "Set EMCC_DEBUG=1"
aheejin Dec 17, 2024
529c8ba
Revert "Temporarily disable -ffile-prefix-map for testing"
aheejin Dec 17, 2024
547b342
Revert "Let embuilder use deterministic paths even when using Ninja"
aheejin Dec 17, 2024
14935a2
Revert "Use CIRCLRCI environment variable"
aheejin Dec 17, 2024
1d7fde3
Revert "More test logging"
aheejin Dec 17, 2024
805a8f0
Define __FILE__ as an empty string in release mode
aheejin Dec 17, 2024
331c421
Rebaseline other.test_minimal_runtime_code_size_hello_embind
aheejin Dec 17, 2024
2933767
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Dec 18, 2024
da301e1
Revert "Define __FILE__ as an empty string in release mode"
aheejin Dec 18, 2024
e6fc63d
Always use -ffile-macro-prefix
aheejin Dec 18, 2024
1f06a45
Rebaseline other.test_minimal_runtime_code_size_hello_embind
aheejin Dec 18, 2024
ba99f7b
Update readme.txt
aheejin Dec 21, 2024
b569cfd
Merge branch 'main' into update_libcxx_libcxxabi_19
aheejin Jan 2, 2025
5f4fba8
Automatic rebaseline of codesize expectations. NFC
aheejin Jan 2, 2025
daa52c3
Update ChangeLog
aheejin Jan 2, 2025
b371d68
Remove stray deterministic_paths from embuilder.py
aheejin Jan 2, 2025
a7c7a60
Revert "Only run other.test_minimal_runtime_code_size_hello_embind"
aheejin Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ See docs/process.md for more on how version tagging works.

3.1.75 (in development)
-----------------------
- compiler-rt was updated to LLVM 19.1.4. (#22937)
- compiler-rt, libcxx, and libcxxabi were updated to LLVM 19.1.4. (#22937 and
#22994)
- The Wasm nontrapping-fptoint feature has been enabled by default. clang will
generate nontrapping (saturating) float-to-int conversion instructions for
C typecasts. This should have no effect on programs that do not have
Expand Down
1 change: 1 addition & 0 deletions system/include/emscripten/val.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cstdint> // uintptr_t
#include <vector>
#include <type_traits>
#include <pthread.h>
#if __cplusplus >= 202002L
#include <coroutine>
#include <variant>
Expand Down
6 changes: 3 additions & 3 deletions system/lib/libcxx/include/__algorithm/adjacent_find.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Iter, class _Sent, class _BinaryPredicate>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
__adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
if (__first == __last)
return __first;
Expand All @@ -40,13 +40,13 @@ __adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
}

template <class _ForwardIterator, class _BinaryPredicate>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) {
return std::__adjacent_find(std::move(__first), std::move(__last), __pred);
}

template <class _ForwardIterator>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
adjacent_find(_ForwardIterator __first, _ForwardIterator __last) {
return std::adjacent_find(std::move(__first), std::move(__last), __equal_to());
}
Expand Down
2 changes: 1 addition & 1 deletion system/lib/libcxx/include/__algorithm/all_of.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD

template <class _InputIterator, class _Predicate>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
for (; __first != __last; ++__first)
if (!__pred(*__first))
Expand Down
2 changes: 1 addition & 1 deletion system/lib/libcxx/include/__algorithm/any_of.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD

template <class _InputIterator, class _Predicate>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
for (; __first != __last; ++__first)
if (__pred(*__first))
Expand Down
4 changes: 2 additions & 2 deletions system/lib/libcxx/include/__algorithm/binary_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD

template <class _ForwardIterator, class _Tp, class _Compare>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
__first = std::lower_bound<_ForwardIterator, _Tp, __comp_ref_type<_Compare> >(__first, __last, __value, __comp);
return __first != __last && !__comp(__value, *__first);
}

template <class _ForwardIterator, class _Tp>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
return std::binary_search(__first, __last, __value, __less<>());
}
Expand Down
4 changes: 2 additions & 2 deletions system/lib/libcxx/include/__algorithm/clamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD

#if _LIBCPP_STD_VER >= 17
template <class _Tp, class _Compare>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
_LIBCPP_LIFETIMEBOUND const _Tp& __lo,
_LIBCPP_LIFETIMEBOUND const _Tp& __hi,
Expand All @@ -31,7 +31,7 @@ clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
}

template <class _Tp>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
_LIBCPP_LIFETIMEBOUND const _Tp& __lo,
_LIBCPP_LIFETIMEBOUND const _Tp& __hi) {
Expand Down
8 changes: 5 additions & 3 deletions system/lib/libcxx/include/__algorithm/comp.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#define _LIBCPP___ALGORITHM_COMP_H

#include <__config>
#include <__type_traits/integral_constant.h>
#include <__type_traits/operation_traits.h>
#include <__type_traits/desugars_to.h>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand All @@ -27,7 +26,7 @@ struct __equal_to {
};

template <class _Tp, class _Up>
struct __desugars_to<__equal_tag, __equal_to, _Tp, _Up> : true_type {};
inline const bool __desugars_to_v<__equal_tag, __equal_to, _Tp, _Up> = true;

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

template <class _Tp>
inline const bool __desugars_to_v<__less_tag, __less<>, _Tp, _Tp> = true;

_LIBCPP_END_NAMESPACE_STD

#endif // _LIBCPP___ALGORITHM_COMP_H
6 changes: 3 additions & 3 deletions system/lib/libcxx/include/__algorithm/comp_ref_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ struct __debug_less {
}

template <class _LHS, class _RHS>
_LIBCPP_CONSTEXPR_SINCE_CXX14 inline _LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(
std::declval<_LHS&>(), std::declval<_RHS&>()))
__do_compare_assert(int, _LHS& __l, _RHS& __r) {
_LIBCPP_CONSTEXPR_SINCE_CXX14 inline
_LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(std::declval<_LHS&>(), std::declval<_RHS&>()))
__do_compare_assert(int, _LHS& __l, _RHS& __r) {
_LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(!__comp_(__l, __r), "Comparator does not induce a strict weak ordering");
(void)__l;
(void)__r;
Expand Down
6 changes: 2 additions & 4 deletions system/lib/libcxx/include/__algorithm/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ template <class, class _InIter, class _Sent, class _OutIter>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter> __copy(_InIter, _Sent, _OutIter);

template <class _AlgPolicy>
struct __copy_loop {
struct __copy_impl {
template <class _InIter, class _Sent, class _OutIter>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
operator()(_InIter __first, _Sent __last, _OutIter __result) const {
Expand Down Expand Up @@ -94,9 +94,7 @@ struct __copy_loop {
__local_first = _Traits::__begin(++__segment_iterator);
}
}
};

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

Expand Down
8 changes: 3 additions & 5 deletions system/lib/libcxx/include/__algorithm/copy_backward.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <__config>
#include <__iterator/segmented_iterator.h>
#include <__type_traits/common_type.h>
#include <__type_traits/is_copy_constructible.h>
#include <__type_traits/is_constructible.h>
#include <__utility/move.h>
#include <__utility/pair.h>

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

template <class _AlgPolicy>
struct __copy_backward_loop {
struct __copy_backward_impl {
template <class _InIter, class _Sent, class _OutIter>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter>
operator()(_InIter __first, _Sent __last, _OutIter __result) const {
Expand Down Expand Up @@ -104,9 +104,7 @@ struct __copy_backward_loop {
__local_last = _Traits::__end(__segment_iterator);
}
}
};

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

Expand Down
42 changes: 8 additions & 34 deletions system/lib/libcxx/include/__algorithm/copy_move_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
#include <__type_traits/enable_if.h>
#include <__type_traits/is_always_bitcastable.h>
#include <__type_traits/is_constant_evaluated.h>
#include <__type_traits/is_copy_constructible.h>
#include <__type_traits/is_constructible.h>
#include <__type_traits/is_trivially_assignable.h>
#include <__type_traits/is_trivially_copyable.h>
#include <__type_traits/is_volatile.h>
#include <__utility/move.h>
#include <__utility/pair.h>
Expand Down Expand Up @@ -81,30 +80,17 @@ __copy_backward_trivial_impl(_In* __first, _In* __last, _Out* __result) {

// Iterator unwrapping and dispatching to the correct overload.

template <class _F1, class _F2>
struct __overload : _F1, _F2 {
using _F1::operator();
using _F2::operator();
};

template <class _InIter, class _Sent, class _OutIter, class = void>
struct __can_rewrap : false_type {};

template <class _InIter, class _Sent, class _OutIter>
struct __can_rewrap<_InIter,
_Sent,
_OutIter,
// Note that sentinels are always copy-constructible.
__enable_if_t< is_copy_constructible<_InIter>::value && is_copy_constructible<_OutIter>::value > >
: true_type {};
template <class _InIter, class _OutIter>
struct __can_rewrap
: integral_constant<bool, is_copy_constructible<_InIter>::value && is_copy_constructible<_OutIter>::value> {};

template <class _Algorithm,
class _InIter,
class _Sent,
class _OutIter,
__enable_if_t<__can_rewrap<_InIter, _Sent, _OutIter>::value, int> = 0>
__enable_if_t<__can_rewrap<_InIter, _OutIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>
__unwrap_and_dispatch(_InIter __first, _Sent __last, _OutIter __out_first) {
__copy_move_unwrap_iters(_InIter __first, _Sent __last, _OutIter __out_first) {
auto __range = std::__unwrap_range(__first, std::move(__last));
auto __result = _Algorithm()(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__out_first));
return std::make_pair(std::__rewrap_range<_Sent>(std::move(__first), std::move(__result.first)),
Expand All @@ -115,24 +101,12 @@ template <class _Algorithm,
class _InIter,
class _Sent,
class _OutIter,
__enable_if_t<!__can_rewrap<_InIter, _Sent, _OutIter>::value, int> = 0>
__enable_if_t<!__can_rewrap<_InIter, _OutIter>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>
__unwrap_and_dispatch(_InIter __first, _Sent __last, _OutIter __out_first) {
__copy_move_unwrap_iters(_InIter __first, _Sent __last, _OutIter __out_first) {
return _Algorithm()(std::move(__first), std::move(__last), std::move(__out_first));
}

template <class _AlgPolicy,
class _NaiveAlgorithm,
class _OptimizedAlgorithm,
class _InIter,
class _Sent,
class _OutIter>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>
__dispatch_copy_or_move(_InIter __first, _Sent __last, _OutIter __out_first) {
using _Algorithm = __overload<_NaiveAlgorithm, _OptimizedAlgorithm>;
return std::__unwrap_and_dispatch<_Algorithm>(std::move(__first), std::move(__last), std::move(__out_first));
}

_LIBCPP_END_NAMESPACE_STD

_LIBCPP_POP_MACROS
Expand Down
2 changes: 1 addition & 1 deletion system/lib/libcxx/include/__algorithm/count.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ __count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __l
}

template <class _InputIterator, class _Tp>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iter_diff_t<_InputIterator>
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __iter_diff_t<_InputIterator>
count(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
__identity __proj;
return std::__count<_ClassicAlgPolicy>(__first, __last, __value, __proj);
Expand Down
6 changes: 3 additions & 3 deletions system/lib/libcxx/include/__algorithm/count_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
_LIBCPP_BEGIN_NAMESPACE_STD

template <class _InputIterator, class _Predicate>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
typename iterator_traits<_InputIterator>::difference_type
count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
typename iterator_traits<_InputIterator>::difference_type
count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
typename iterator_traits<_InputIterator>::difference_type __r(0);
for (; __first != __last; ++__first)
if (__pred(*__first))
Expand Down
Loading
Loading