From 156ab8750056c3ff440af0937806d8cdb2623816 Mon Sep 17 00:00:00 2001 From: Alex Rønne Petersen Date: Wed, 5 Feb 2025 10:50:09 +0100 Subject: libcxx: Update to Clang 20. See: * https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc/77319 * https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701 We're dropping support for C++03 for Zig due to the first change; it would be insane to ship 1018 duplicate header files just for this outdated use case. As a result of the second change, I had to bring in a subset of the headers from llvm-libc since libc++ now depends on these. Hopefully we can continue to get away with not copying the entirety of llvm-libc. --- lib/libcxx/include/__algorithm/copy.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'lib/libcxx/include/__algorithm/copy.h') diff --git a/lib/libcxx/include/__algorithm/copy.h b/lib/libcxx/include/__algorithm/copy.h index 0890b895f5..962aa90059 100644 --- a/lib/libcxx/include/__algorithm/copy.h +++ b/lib/libcxx/include/__algorithm/copy.h @@ -11,11 +11,12 @@ #include <__algorithm/copy_move_common.h> #include <__algorithm/for_each_segment.h> -#include <__algorithm/iterator_operations.h> #include <__algorithm/min.h> #include <__config> +#include <__iterator/iterator_traits.h> #include <__iterator/segmented_iterator.h> #include <__type_traits/common_type.h> +#include <__type_traits/enable_if.h> #include <__utility/move.h> #include <__utility/pair.h> @@ -28,10 +29,9 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD -template +template inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter> __copy(_InIter, _Sent, _OutIter); -template struct __copy_impl { template _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InIter, _OutIter> @@ -47,7 +47,7 @@ struct __copy_impl { template struct _CopySegment { - using _Traits = __segmented_iterator_traits<_InIter>; + using _Traits _LIBCPP_NODEBUG = __segmented_iterator_traits<_InIter>; _OutIter& __result_; @@ -56,7 +56,7 @@ struct __copy_impl { _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void operator()(typename _Traits::__local_iterator __lfirst, typename _Traits::__local_iterator __llast) { - __result_ = std::__copy<_AlgPolicy>(__lfirst, __llast, std::move(__result_)).second; + __result_ = std::__copy(__lfirst, __llast, std::move(__result_)).second; } }; @@ -85,7 +85,7 @@ struct __copy_impl { while (true) { auto __local_last = _Traits::__end(__segment_iterator); auto __size = std::min<_DiffT>(__local_last - __local_first, __last - __first); - auto __iters = std::__copy<_AlgPolicy>(__first, __first + __size, __local_first); + auto __iters = std::__copy(__first, __first + __size, __local_first); __first = std::move(__iters.first); if (__first == __last) @@ -103,17 +103,16 @@ struct __copy_impl { } }; -template +template pair<_InIter, _OutIter> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __copy(_InIter __first, _Sent __last, _OutIter __result) { - return std::__copy_move_unwrap_iters<__copy_impl<_AlgPolicy> >( - std::move(__first), std::move(__last), std::move(__result)); + return std::__copy_move_unwrap_iters<__copy_impl>(std::move(__first), std::move(__last), std::move(__result)); } template inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { - return std::__copy<_ClassicAlgPolicy>(__first, __last, __result).second; + return std::__copy(__first, __last, __result).second; } _LIBCPP_END_NAMESPACE_STD -- cgit v1.2.3