diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2022-09-21 20:17:38 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2022-09-21 20:17:38 +0300 |
commit | e6c9b17192c56494adba359d5e132c431b241191 (patch) | |
tree | 6f2449871a118a0e8919ce842b1174e06cb470ef /contrib/libs | |
parent | 285021ab1aac39e84b269d9bacd4deee69cf63fc (diff) | |
download | ydb-e6c9b17192c56494adba359d5e132c431b241191.tar.gz |
Ydb stable 22-4-2122.4.21
x-stable-origin-commit: e89099581237299a132feafb5b58af59ebd0468a
Diffstat (limited to 'contrib/libs')
102 files changed, 4809 insertions, 411 deletions
diff --git a/contrib/libs/CMakeLists.darwin.txt b/contrib/libs/CMakeLists.darwin.txt new file mode 100644 index 0000000000..db4d5e7fb8 --- /dev/null +++ b/contrib/libs/CMakeLists.darwin.txt @@ -0,0 +1,53 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(antlr3_cpp_runtime) +add_subdirectory(apache) +add_subdirectory(aws-sdk-cpp) +add_subdirectory(base64) +add_subdirectory(brotli) +add_subdirectory(cctz) +add_subdirectory(crcutil) +add_subdirectory(curl) +add_subdirectory(cxxsupp) +add_subdirectory(double-conversion) +add_subdirectory(farmhash) +add_subdirectory(fastlz) +add_subdirectory(fmt) +add_subdirectory(grpc) +add_subdirectory(hdr_histogram) +add_subdirectory(highwayhash) +add_subdirectory(hyperscan) +add_subdirectory(jemalloc) +add_subdirectory(jwt-cpp) +add_subdirectory(libbz2) +add_subdirectory(libc_compat) +add_subdirectory(libevent) +add_subdirectory(libunwind) +add_subdirectory(libxml) +add_subdirectory(linuxvdso) +add_subdirectory(llvm12) +add_subdirectory(lz4) +add_subdirectory(lzmasdk) +add_subdirectory(nayuki_md5) +add_subdirectory(nghttp2) +add_subdirectory(pcre) +add_subdirectory(protobuf) +add_subdirectory(protoc) +add_subdirectory(rapidjson) +add_subdirectory(re2) +add_subdirectory(snappy) +add_subdirectory(sparsehash) +add_subdirectory(t1ha) +add_subdirectory(tbb) +add_subdirectory(tcmalloc) +add_subdirectory(utf8proc) +add_subdirectory(xxhash) +add_subdirectory(yaml-cpp) +add_subdirectory(zstd) +add_subdirectory(zstd06) diff --git a/contrib/libs/CMakeLists.linux.txt b/contrib/libs/CMakeLists.linux.txt new file mode 100644 index 0000000000..804ea5a55f --- /dev/null +++ b/contrib/libs/CMakeLists.linux.txt @@ -0,0 +1,57 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(antlr3_cpp_runtime) +add_subdirectory(apache) +add_subdirectory(aws-sdk-cpp) +add_subdirectory(base64) +add_subdirectory(brotli) +add_subdirectory(cctz) +add_subdirectory(crcutil) +add_subdirectory(curl) +add_subdirectory(cxxsupp) +add_subdirectory(double-conversion) +add_subdirectory(expat) +add_subdirectory(farmhash) +add_subdirectory(fastlz) +add_subdirectory(fmt) +add_subdirectory(grpc) +add_subdirectory(hdr_histogram) +add_subdirectory(highwayhash) +add_subdirectory(hyperscan) +add_subdirectory(jemalloc) +add_subdirectory(jwt-cpp) +add_subdirectory(libbz2) +add_subdirectory(libc_compat) +add_subdirectory(libevent) +add_subdirectory(libunwind) +add_subdirectory(libxml) +add_subdirectory(linuxvdso) +add_subdirectory(llvm12) +add_subdirectory(lz4) +add_subdirectory(lzma) +add_subdirectory(lzmasdk) +add_subdirectory(nayuki_md5) +add_subdirectory(nghttp2) +add_subdirectory(pcre) +add_subdirectory(pdqsort) +add_subdirectory(poco) +add_subdirectory(protobuf) +add_subdirectory(protoc) +add_subdirectory(rapidjson) +add_subdirectory(re2) +add_subdirectory(snappy) +add_subdirectory(sparsehash) +add_subdirectory(t1ha) +add_subdirectory(tbb) +add_subdirectory(tcmalloc) +add_subdirectory(utf8proc) +add_subdirectory(xxhash) +add_subdirectory(yaml-cpp) +add_subdirectory(zstd) +add_subdirectory(zstd06) diff --git a/contrib/libs/CMakeLists.txt b/contrib/libs/CMakeLists.txt new file mode 100644 index 0000000000..dbfe6fa2c4 --- /dev/null +++ b/contrib/libs/CMakeLists.txt @@ -0,0 +1,13 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) + include(CMakeLists.linux.txt) +endif() diff --git a/contrib/libs/apache/CMakeLists.darwin.txt b/contrib/libs/apache/CMakeLists.darwin.txt new file mode 100644 index 0000000000..d0743a109b --- /dev/null +++ b/contrib/libs/apache/CMakeLists.darwin.txt @@ -0,0 +1,10 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(arrow) +add_subdirectory(orc) diff --git a/contrib/libs/apache/CMakeLists.linux.txt b/contrib/libs/apache/CMakeLists.linux.txt new file mode 100644 index 0000000000..e1bf69d210 --- /dev/null +++ b/contrib/libs/apache/CMakeLists.linux.txt @@ -0,0 +1,11 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(arrow) +add_subdirectory(avro) +add_subdirectory(orc) diff --git a/contrib/libs/apache/CMakeLists.txt b/contrib/libs/apache/CMakeLists.txt new file mode 100644 index 0000000000..dbfe6fa2c4 --- /dev/null +++ b/contrib/libs/apache/CMakeLists.txt @@ -0,0 +1,13 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) + include(CMakeLists.linux.txt) +endif() diff --git a/contrib/libs/apache/avro/CMakeLists.txt b/contrib/libs/apache/avro/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/apache/avro/CMakeLists.txt +++ b/contrib/libs/apache/avro/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/aws-sdk-cpp/CMakeLists.txt b/contrib/libs/aws-sdk-cpp/CMakeLists.txt new file mode 100644 index 0000000000..cbf8273ba6 --- /dev/null +++ b/contrib/libs/aws-sdk-cpp/CMakeLists.txt @@ -0,0 +1,10 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(aws-cpp-sdk-core) +add_subdirectory(aws-cpp-sdk-s3) diff --git a/contrib/libs/base64/CMakeLists.txt b/contrib/libs/base64/CMakeLists.txt new file mode 100644 index 0000000000..5744b7efd3 --- /dev/null +++ b/contrib/libs/base64/CMakeLists.txt @@ -0,0 +1,14 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(avx2) +add_subdirectory(neon32) +add_subdirectory(neon64) +add_subdirectory(plain32) +add_subdirectory(plain64) +add_subdirectory(ssse3) diff --git a/contrib/libs/brotli/CMakeLists.txt b/contrib/libs/brotli/CMakeLists.txt new file mode 100644 index 0000000000..69449669e8 --- /dev/null +++ b/contrib/libs/brotli/CMakeLists.txt @@ -0,0 +1,11 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(common) +add_subdirectory(dec) +add_subdirectory(enc) diff --git a/contrib/libs/cctz/CMakeLists.darwin.txt b/contrib/libs/cctz/CMakeLists.darwin.txt index 0e28714675..6068d1079a 100644 --- a/contrib/libs/cctz/CMakeLists.darwin.txt +++ b/contrib/libs/cctz/CMakeLists.darwin.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(tzdata) add_library(contrib-libs-cctz) target_compile_options(contrib-libs-cctz PRIVATE diff --git a/contrib/libs/cctz/CMakeLists.linux.txt b/contrib/libs/cctz/CMakeLists.linux.txt index fa995d5000..01e6420897 100644 --- a/contrib/libs/cctz/CMakeLists.linux.txt +++ b/contrib/libs/cctz/CMakeLists.linux.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(tzdata) add_library(contrib-libs-cctz) target_compile_options(contrib-libs-cctz PRIVATE diff --git a/contrib/libs/cctz/CMakeLists.txt b/contrib/libs/cctz/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/cctz/CMakeLists.txt +++ b/contrib/libs/cctz/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/curl/CMakeLists.txt b/contrib/libs/curl/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/curl/CMakeLists.txt +++ b/contrib/libs/curl/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/cxxsupp/CMakeLists.txt b/contrib/libs/cxxsupp/CMakeLists.txt index aa4ccf6398..236767d79f 100644 --- a/contrib/libs/cxxsupp/CMakeLists.txt +++ b/contrib/libs/cxxsupp/CMakeLists.txt @@ -6,6 +6,10 @@ # original buildsystem will not be accepted. +add_subdirectory(builtins) +add_subdirectory(libcxx) +add_subdirectory(libcxxabi-parts) +add_subdirectory(libcxxrt) add_library(contrib-libs-cxxsupp INTERFACE) target_link_libraries(contrib-libs-cxxsupp INTERFACE diff --git a/contrib/libs/cxxsupp/builtins/CMakeLists.txt b/contrib/libs/cxxsupp/builtins/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/cxxsupp/builtins/CMakeLists.txt +++ b/contrib/libs/cxxsupp/builtins/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h new file mode 100644 index 0000000000..54916fd476 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h @@ -0,0 +1,82 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_ALL_H +#define _LIBCPP___RANGES_ALL_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <__ranges/owning_view.h> +#include <__ranges/range_adaptor.h> +#include <__ranges/ref_view.h> +#include <__utility/auto_cast.h> +#include <__utility/declval.h> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges::views { + +namespace __all { + struct __fn : __range_adaptor_closure<__fn> { + template<class _Tp> + requires ranges::view<decay_t<_Tp>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)))) + { + return _LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)); + } + + template<class _Tp> + requires (!ranges::view<decay_t<_Tp>>) && + requires (_Tp&& __t) { ranges::ref_view{std::forward<_Tp>(__t)}; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::ref_view{std::forward<_Tp>(__t)})) + { + return ranges::ref_view{std::forward<_Tp>(__t)}; + } + + template<class _Tp> + requires (!ranges::view<decay_t<_Tp>> && + !requires (_Tp&& __t) { ranges::ref_view{std::forward<_Tp>(__t)}; } && + requires (_Tp&& __t) { ranges::owning_view{std::forward<_Tp>(__t)}; }) + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::owning_view{std::forward<_Tp>(__t)})) + { + return ranges::owning_view{std::forward<_Tp>(__t)}; + } + }; +} // namespace __all + +inline namespace __cpo { + inline constexpr auto all = __all::__fn{}; +} // namespace __cpo + +template<ranges::viewable_range _Range> +using all_t = decltype(views::all(declval<_Range>())); + +} // namespace ranges::views + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_ALL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h new file mode 100644 index 0000000000..3f58dafeb0 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h @@ -0,0 +1,135 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_COMMON_VIEW_H +#define _LIBCPP___RANGES_COMMON_VIEW_H + +#include <__config> +#include <__iterator/common_iterator.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/range_adaptor.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + +template<view _View> + requires (!common_range<_View> && copyable<iterator_t<_View>>) +class common_view : public view_interface<common_view<_View>> { + _View __base_ = _View(); + +public: + _LIBCPP_HIDE_FROM_ABI + common_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit common_view(_View __v) : __base_(std::move(__v)) { } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return std::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() { + if constexpr (random_access_range<_View> && sized_range<_View>) + return ranges::begin(__base_); + else + return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const requires range<const _View> { + if constexpr (random_access_range<const _View> && sized_range<const _View>) + return ranges::begin(__base_); + else + return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() { + if constexpr (random_access_range<_View> && sized_range<_View>) + return ranges::begin(__base_) + ranges::size(__base_); + else + return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const requires range<const _View> { + if constexpr (random_access_range<const _View> && sized_range<const _View>) + return ranges::begin(__base_) + ranges::size(__base_); + else + return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() requires sized_range<_View> { + return ranges::size(__base_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const requires sized_range<const _View> { + return ranges::size(__base_); + } +}; + +template<class _Range> +common_view(_Range&&) + -> common_view<views::all_t<_Range>>; + +template<class _View> +inline constexpr bool enable_borrowed_range<common_view<_View>> = enable_borrowed_range<_View>; + +namespace views { +namespace __common { + struct __fn : __range_adaptor_closure<__fn> { + template<class _Range> + requires common_range<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(views::all(std::forward<_Range>(__range)))) + -> decltype( views::all(std::forward<_Range>(__range))) + { return views::all(std::forward<_Range>(__range)); } + + template<class _Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(common_view{std::forward<_Range>(__range)})) + -> decltype( common_view{std::forward<_Range>(__range)}) + { return common_view{std::forward<_Range>(__range)}; } + }; +} // namespace __common + +inline namespace __cpo { + inline constexpr auto common = __common::__fn{}; +} // namespace __cpo +} // namespace views +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_COMMON_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h new file mode 100644 index 0000000000..8b7f227925 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h @@ -0,0 +1,178 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANGES_COPYABLE_BOX_H +#define _LIBCPP___RANGES_COPYABLE_BOX_H + +#include <__config> +#include <__memory/addressof.h> +#include <__memory/construct_at.h> +#include <__utility/move.h> +#include <concepts> +#include <optional> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// __copyable_box allows turning a type that is copy-constructible (but maybe not copy-assignable) into +// a type that is both copy-constructible and copy-assignable. It does that by introducing an empty state +// and basically doing destroy-then-copy-construct in the assignment operator. The empty state is necessary +// to handle the case where the copy construction fails after destroying the object. +// +// In some cases, we can completely avoid the use of an empty state; we provide a specialization of +// __copyable_box that does this, see below for the details. + +template<class _Tp> +concept __copy_constructible_object = copy_constructible<_Tp> && is_object_v<_Tp>; + +namespace ranges { + // Primary template - uses std::optional and introduces an empty state in case assignment fails. + template<__copy_constructible_object _Tp> + class __copyable_box { + _LIBCPP_NO_UNIQUE_ADDRESS optional<_Tp> __val_; + + public: + template<class ..._Args> + requires is_constructible_v<_Tp, _Args...> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __copyable_box(in_place_t, _Args&& ...__args) + noexcept(is_nothrow_constructible_v<_Tp, _Args...>) + : __val_(in_place, std::forward<_Args>(__args)...) + { } + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>) + requires default_initializable<_Tp> + : __val_(in_place) + { } + + _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default; + _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box& operator=(__copyable_box const& __other) + noexcept(is_nothrow_copy_constructible_v<_Tp>) + { + if (this != std::addressof(__other)) { + if (__other.__has_value()) __val_.emplace(*__other); + else __val_.reset(); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box& operator=(__copyable_box&& __other) + noexcept(is_nothrow_move_constructible_v<_Tp>) + { + if (this != std::addressof(__other)) { + if (__other.__has_value()) __val_.emplace(std::move(*__other)); + else __val_.reset(); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return *__val_; } + _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return *__val_; } + + _LIBCPP_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return __val_.operator->(); } + _LIBCPP_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return __val_.operator->(); } + + _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return __val_.has_value(); } + }; + + // This partial specialization implements an optimization for when we know we don't need to store + // an empty state to represent failure to perform an assignment. For copy-assignment, this happens: + // + // 1. If the type is copyable (which includes copy-assignment), we can use the type's own assignment operator + // directly and avoid using std::optional. + // 2. If the type is not copyable, but it is nothrow-copy-constructible, then we can implement assignment as + // destroy-and-then-construct and we know it will never fail, so we don't need an empty state. + // + // The exact same reasoning can be applied for move-assignment, with copyable replaced by movable and + // nothrow-copy-constructible replaced by nothrow-move-constructible. This specialization is enabled + // whenever we can apply any of these optimizations for both the copy assignment and the move assignment + // operator. + template<class _Tp> + concept __doesnt_need_empty_state_for_copy = copyable<_Tp> || is_nothrow_copy_constructible_v<_Tp>; + + template<class _Tp> + concept __doesnt_need_empty_state_for_move = movable<_Tp> || is_nothrow_move_constructible_v<_Tp>; + + template<__copy_constructible_object _Tp> + requires __doesnt_need_empty_state_for_copy<_Tp> && __doesnt_need_empty_state_for_move<_Tp> + class __copyable_box<_Tp> { + _LIBCPP_NO_UNIQUE_ADDRESS _Tp __val_; + + public: + template<class ..._Args> + requires is_constructible_v<_Tp, _Args...> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __copyable_box(in_place_t, _Args&& ...__args) + noexcept(is_nothrow_constructible_v<_Tp, _Args...>) + : __val_(std::forward<_Args>(__args)...) + { } + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>) + requires default_initializable<_Tp> + : __val_() + { } + + _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default; + _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default; + + // Implementation of assignment operators in case we perform optimization (1) + _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box const&) requires copyable<_Tp> = default; + _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default; + + // Implementation of assignment operators in case we perform optimization (2) + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box& operator=(__copyable_box const& __other) noexcept { + static_assert(is_nothrow_copy_constructible_v<_Tp>); + if (this != std::addressof(__other)) { + std::destroy_at(std::addressof(__val_)); + std::construct_at(std::addressof(__val_), __other.__val_); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box& operator=(__copyable_box&& __other) noexcept { + static_assert(is_nothrow_move_constructible_v<_Tp>); + if (this != std::addressof(__other)) { + std::destroy_at(std::addressof(__val_)); + std::construct_at(std::addressof(__val_), std::move(__other.__val_)); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return __val_; } + _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return __val_; } + + _LIBCPP_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return std::addressof(__val_); } + _LIBCPP_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return std::addressof(__val_); } + + _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return true; } + }; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_COPYABLE_BOX_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h new file mode 100644 index 0000000000..400284c48e --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h @@ -0,0 +1,81 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_COUNTED_H +#define _LIBCPP___RANGES_COUNTED_H + +#include <__concepts/convertible_to.h> +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/counted_iterator.h> +#include <__iterator/default_sentinel.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__memory/pointer_traits.h> +#include <__ranges/subrange.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <span> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges::views { + +namespace __counted { + + struct __fn { + template<contiguous_iterator _It> + _LIBCPP_HIDE_FROM_ABI + static constexpr auto __go(_It __it, iter_difference_t<_It> __count) + noexcept(noexcept(span(std::to_address(__it), static_cast<size_t>(__count)))) + // Deliberately omit return-type SFINAE, because to_address is not SFINAE-friendly + { return span(std::to_address(__it), static_cast<size_t>(__count)); } + + template<random_access_iterator _It> + _LIBCPP_HIDE_FROM_ABI + static constexpr auto __go(_It __it, iter_difference_t<_It> __count) + noexcept(noexcept(subrange(__it, __it + __count))) + -> decltype( subrange(__it, __it + __count)) + { return subrange(__it, __it + __count); } + + template<class _It> + _LIBCPP_HIDE_FROM_ABI + static constexpr auto __go(_It __it, iter_difference_t<_It> __count) + noexcept(noexcept(subrange(counted_iterator(std::move(__it), __count), default_sentinel))) + -> decltype( subrange(counted_iterator(std::move(__it), __count), default_sentinel)) + { return subrange(counted_iterator(std::move(__it), __count), default_sentinel); } + + template<class _It, convertible_to<iter_difference_t<_It>> _Diff> + requires input_or_output_iterator<decay_t<_It>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_It&& __it, _Diff&& __count) const + noexcept(noexcept(__go(std::forward<_It>(__it), std::forward<_Diff>(__count)))) + -> decltype( __go(std::forward<_It>(__it), std::forward<_Diff>(__count))) + { return __go(std::forward<_It>(__it), std::forward<_Diff>(__count)); } + }; + +} // namespace __counted + +inline namespace __cpo { + inline constexpr auto counted = __counted::__fn{}; +} // namespace __cpo + +} // namespace ranges::views + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_COUNTED_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h new file mode 100644 index 0000000000..0e5b68b11d --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h @@ -0,0 +1,127 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_DROP_VIEW_H +#define _LIBCPP___RANGES_DROP_VIEW_H + +#include <__config> +#include <__debug> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/next.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/non_propagating_cache.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<view _View> + class drop_view + : public view_interface<drop_view<_View>> + { + // We cache begin() whenever ranges::next is not guaranteed O(1) to provide an + // amortized O(1) begin() method. If this is an input_range, then we cannot cache + // begin because begin is not equality preserving. + // Note: drop_view<input-range>::begin() is still trivially amortized O(1) because + // one can't call begin() on it more than once. + static constexpr bool _UseCache = forward_range<_View> && !(random_access_range<_View> && sized_range<_View>); + using _Cache = _If<_UseCache, __non_propagating_cache<iterator_t<_View>>, __empty_cache>; + _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache(); + range_difference_t<_View> __count_ = 0; + _View __base_ = _View(); + +public: + drop_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr drop_view(_View __base, range_difference_t<_View> __count) + : __count_(__count) + , __base_(std::move(__base)) + { + _LIBCPP_ASSERT(__count_ >= 0, "count must be greater than or equal to zero."); + } + + _LIBCPP_HIDE_FROM_ABI constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() + requires (!(__simple_view<_View> && + random_access_range<const _View> && sized_range<const _View>)) + { + if constexpr (_UseCache) + if (__cached_begin_.__has_value()) + return *__cached_begin_; + + auto __tmp = ranges::next(ranges::begin(__base_), __count_, ranges::end(__base_)); + if constexpr (_UseCache) + __cached_begin_.__emplace(__tmp); + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const + requires random_access_range<const _View> && sized_range<const _View> + { + return ranges::next(ranges::begin(__base_), __count_, ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() + requires (!__simple_view<_View>) + { return ranges::end(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const + requires range<const _View> + { return ranges::end(__base_); } + + _LIBCPP_HIDE_FROM_ABI + static constexpr auto __size(auto& __self) { + const auto __s = ranges::size(__self.__base_); + const auto __c = static_cast<decltype(__s)>(__self.__count_); + return __s < __c ? 0 : __s - __c; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() + requires sized_range<_View> + { return __size(*this); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const + requires sized_range<const _View> + { return __size(*this); } + }; + + template<class _Range> + drop_view(_Range&&, range_difference_t<_Range>) -> drop_view<views::all_t<_Range>>; + + template<class _Tp> + inline constexpr bool enable_borrowed_range<drop_view<_Tp>> = enable_borrowed_range<_Tp>; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_DROP_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h new file mode 100644 index 0000000000..c83cdd7482 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h @@ -0,0 +1,82 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_EMPTY_H +#define _LIBCPP___RANGES_EMPTY_H + +#include <__concepts/class_or_enum.h> +#include <__config> +#include <__iterator/concepts.h> +#include <__ranges/access.h> +#include <__ranges/size.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [range.prim.empty] + +namespace ranges { +namespace __empty { + template <class _Tp> + concept __member_empty = + __workaround_52970<_Tp> && + requires(_Tp&& __t) { + bool(__t.empty()); + }; + + template<class _Tp> + concept __can_invoke_size = + !__member_empty<_Tp> && + requires(_Tp&& __t) { ranges::size(__t); }; + + template <class _Tp> + concept __can_compare_begin_end = + !__member_empty<_Tp> && + !__can_invoke_size<_Tp> && + requires(_Tp&& __t) { + bool(ranges::begin(__t) == ranges::end(__t)); + { ranges::begin(__t) } -> forward_iterator; + }; + + struct __fn { + template <__member_empty _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const + noexcept(noexcept(bool(__t.empty()))) { + return bool(__t.empty()); + } + + template <__can_invoke_size _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const + noexcept(noexcept(ranges::size(__t))) { + return ranges::size(__t) == 0; + } + + template<__can_compare_begin_end _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const + noexcept(noexcept(bool(ranges::begin(__t) == ranges::end(__t)))) { + return ranges::begin(__t) == ranges::end(__t); + } + }; +} // namespace __empty + +inline namespace __cpo { + inline constexpr auto empty = __empty::__fn{}; +} // namespace __cpo +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_EMPTY_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h new file mode 100644 index 0000000000..232b0b8fad --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h @@ -0,0 +1,45 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_EMPTY_VIEW_H +#define _LIBCPP___RANGES_EMPTY_VIEW_H + +#include <__config> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/view_interface.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<class _Tp> + requires is_object_v<_Tp> + class empty_view : public view_interface<empty_view<_Tp>> { + public: + _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; } + _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; } + _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; } + _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; } + _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; } + }; + + template<class _Tp> + inline constexpr bool enable_borrowed_range<empty_view<_Tp>> = true; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_EMPTY_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h new file mode 100644 index 0000000000..2fbc607789 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h @@ -0,0 +1,408 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_IOTA_VIEW_H +#define _LIBCPP___RANGES_IOTA_VIEW_H + +#include <__compare/three_way_comparable.h> +#include <__concepts/arithmetic.h> +#include <__concepts/constructible.h> +#include <__concepts/convertible_to.h> +#include <__concepts/copyable.h> +#include <__concepts/equality_comparable.h> +#include <__concepts/invocable.h> +#include <__concepts/same_as.h> +#include <__concepts/semiregular.h> +#include <__concepts/totally_ordered.h> +#include <__config> +#include <__debug> +#include <__functional/ranges_operations.h> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/unreachable_sentinel.h> +#include <__ranges/copyable_box.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<class _Int> + struct __get_wider_signed { + static auto __call() { + if constexpr (sizeof(_Int) < sizeof(short)) return type_identity<short>{}; + else if constexpr (sizeof(_Int) < sizeof(int)) return type_identity<int>{}; + else if constexpr (sizeof(_Int) < sizeof(long)) return type_identity<long>{}; + else return type_identity<long long>{}; + + static_assert(sizeof(_Int) <= sizeof(long long), + "Found integer-like type that is bigger than largest integer like type."); + } + + using type = typename decltype(__call())::type; + }; + + template<class _Start> + using _IotaDiffT = typename _If< + (!integral<_Start> || sizeof(iter_difference_t<_Start>) > sizeof(_Start)), + type_identity<iter_difference_t<_Start>>, + __get_wider_signed<_Start> + >::type; + + template<class _Iter> + concept __decrementable = incrementable<_Iter> && requires(_Iter __i) { + { --__i } -> same_as<_Iter&>; + { __i-- } -> same_as<_Iter>; + }; + + template<class _Iter> + concept __advanceable = + __decrementable<_Iter> && totally_ordered<_Iter> && + requires(_Iter __i, const _Iter __j, const _IotaDiffT<_Iter> __n) { + { __i += __n } -> same_as<_Iter&>; + { __i -= __n } -> same_as<_Iter&>; + _Iter(__j + __n); + _Iter(__n + __j); + _Iter(__j - __n); + { __j - __j } -> convertible_to<_IotaDiffT<_Iter>>; + }; + + template<class> + struct __iota_iterator_category {}; + + template<incrementable _Tp> + struct __iota_iterator_category<_Tp> { + using iterator_category = input_iterator_tag; + }; + + template<weakly_incrementable _Start, semiregular _Bound = unreachable_sentinel_t> + requires __weakly_equality_comparable_with<_Start, _Bound> && copyable<_Start> + class iota_view : public view_interface<iota_view<_Start, _Bound>> { + struct __iterator : public __iota_iterator_category<_Start> { + friend class iota_view; + + using iterator_concept = + _If<__advanceable<_Start>, random_access_iterator_tag, + _If<__decrementable<_Start>, bidirectional_iterator_tag, + _If<incrementable<_Start>, forward_iterator_tag, + /*Else*/ input_iterator_tag>>>; + + using value_type = _Start; + using difference_type = _IotaDiffT<_Start>; + + _Start __value_ = _Start(); + + _LIBCPP_HIDE_FROM_ABI + __iterator() requires default_initializable<_Start> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __iterator(_Start __value) : __value_(std::move(__value)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _Start operator*() const noexcept(is_nothrow_copy_constructible_v<_Start>) { + return __value_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator++() { + ++__value_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr void operator++(int) { ++*this; } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator++(int) requires incrementable<_Start> { + auto __tmp = *this; + ++*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator--() requires __decrementable<_Start> { + --__value_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator--(int) requires __decrementable<_Start> { + auto __tmp = *this; + --*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator+=(difference_type __n) + requires __advanceable<_Start> + { + if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) { + if (__n >= difference_type(0)) { + __value_ += static_cast<_Start>(__n); + } else { + __value_ -= static_cast<_Start>(-__n); + } + } else { + __value_ += __n; + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator-=(difference_type __n) + requires __advanceable<_Start> + { + if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) { + if (__n >= difference_type(0)) { + __value_ -= static_cast<_Start>(__n); + } else { + __value_ += static_cast<_Start>(-__n); + } + } else { + __value_ -= __n; + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Start operator[](difference_type __n) const + requires __advanceable<_Start> + { + return _Start(__value_ + __n); + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) + requires equality_comparable<_Start> + { + return __x.__value_ == __y.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> + { + return __x.__value_ < __y.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> + { + return __y < __x; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> + { + return !(__y < __x); + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> + { + return !(__x < __y); + } + + friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> && three_way_comparable<_Start> + { + return __x.__value_ <=> __y.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator+(__iterator __i, difference_type __n) + requires __advanceable<_Start> + { + __i += __n; + return __i; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator+(difference_type __n, __iterator __i) + requires __advanceable<_Start> + { + return __i + __n; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator-(__iterator __i, difference_type __n) + requires __advanceable<_Start> + { + __i -= __n; + return __i; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y) + requires __advanceable<_Start> + { + if constexpr (__integer_like<_Start>) { + if constexpr (__signed_integer_like<_Start>) { + return difference_type(difference_type(__x.__value_) - difference_type(__y.__value_)); + } + if (__y.__value_ > __x.__value_) { + return difference_type(-difference_type(__y.__value_ - __x.__value_)); + } + return difference_type(__x.__value_ - __y.__value_); + } + return __x.__value_ - __y.__value_; + } + }; + + struct __sentinel { + friend class iota_view; + + private: + _Bound __bound_ = _Bound(); + + public: + _LIBCPP_HIDE_FROM_ABI + __sentinel() = default; + constexpr explicit __sentinel(_Bound __bound) : __bound_(std::move(__bound)) {} + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator& __x, const __sentinel& __y) { + return __x.__value_ == __y.__bound_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr iter_difference_t<_Start> operator-(const __iterator& __x, const __sentinel& __y) + requires sized_sentinel_for<_Bound, _Start> + { + return __x.__value_ - __y.__bound_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr iter_difference_t<_Start> operator-(const __sentinel& __x, const __iterator& __y) + requires sized_sentinel_for<_Bound, _Start> + { + return -(__y - __x); + } + }; + + _Start __value_ = _Start(); + _Bound __bound_ = _Bound(); + + public: + _LIBCPP_HIDE_FROM_ABI + iota_view() requires default_initializable<_Start> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit iota_view(_Start __value) : __value_(std::move(__value)) { } + + _LIBCPP_HIDE_FROM_ABI + constexpr iota_view(type_identity_t<_Start> __value, type_identity_t<_Bound> __bound) + : __value_(std::move(__value)), __bound_(std::move(__bound)) { + // Validate the precondition if possible. + if constexpr (totally_ordered_with<_Start, _Bound>) { + _LIBCPP_ASSERT(ranges::less_equal()(__value_, __bound_), + "Precondition violated: value is greater than bound."); + } + } + + _LIBCPP_HIDE_FROM_ABI + constexpr iota_view(__iterator __first, __iterator __last) + requires same_as<_Start, _Bound> + : iota_view(std::move(__first.__value_), std::move(__last.__value_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr iota_view(__iterator __first, _Bound __last) + requires same_as<_Bound, unreachable_sentinel_t> + : iota_view(std::move(__first.__value_), std::move(__last)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr iota_view(__iterator __first, __sentinel __last) + requires (!same_as<_Start, _Bound> && !same_as<_Start, unreachable_sentinel_t>) + : iota_view(std::move(__first.__value_), std::move(__last.__bound_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator begin() const { return __iterator{__value_}; } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const { + if constexpr (same_as<_Bound, unreachable_sentinel_t>) + return unreachable_sentinel; + else + return __sentinel{__bound_}; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator end() const requires same_as<_Start, _Bound> { + return __iterator{__bound_}; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const + requires (same_as<_Start, _Bound> && __advanceable<_Start>) || + (integral<_Start> && integral<_Bound>) || + sized_sentinel_for<_Bound, _Start> + { + if constexpr (__integer_like<_Start> && __integer_like<_Bound>) { + if (__value_ < 0) { + if (__bound_ < 0) { + return std::__to_unsigned_like(-__value_) - std::__to_unsigned_like(-__bound_); + } + return std::__to_unsigned_like(__bound_) + std::__to_unsigned_like(-__value_); + } + return std::__to_unsigned_like(__bound_) - std::__to_unsigned_like(__value_); + } + return std::__to_unsigned_like(__bound_ - __value_); + } + }; + + template<class _Start, class _Bound> + requires (!__integer_like<_Start> || !__integer_like<_Bound> || + (__signed_integer_like<_Start> == __signed_integer_like<_Bound>)) + iota_view(_Start, _Bound) -> iota_view<_Start, _Bound>; + + template<class _Start, class _Bound> + inline constexpr bool enable_borrowed_range<iota_view<_Start, _Bound>> = true; + +namespace views { +namespace __iota { + struct __fn { + template<class _Start> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Start&& __start) const + noexcept(noexcept(ranges::iota_view(std::forward<_Start>(__start)))) + -> decltype( ranges::iota_view(std::forward<_Start>(__start))) + { return ranges::iota_view(std::forward<_Start>(__start)); } + + template<class _Start, class _Bound> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Start&& __start, _Bound&& __bound) const + noexcept(noexcept(ranges::iota_view(std::forward<_Start>(__start), std::forward<_Bound>(__bound)))) + -> decltype( ranges::iota_view(std::forward<_Start>(__start), std::forward<_Bound>(__bound))) + { return ranges::iota_view(std::forward<_Start>(__start), std::forward<_Bound>(__bound)); } + }; +} // namespace __iota + +inline namespace __cpo { + inline constexpr auto iota = __iota::__fn{}; +} // namespace __cpo +} // namespace views +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_IOTA_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h new file mode 100644 index 0000000000..18180984d1 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h @@ -0,0 +1,350 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_JOIN_VIEW_H +#define _LIBCPP___RANGES_JOIN_VIEW_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/non_propagating_cache.h> +#include <__ranges/ref_view.h> +#include <__ranges/subrange.h> +#include <__ranges/view_interface.h> +#include <__utility/declval.h> +#include <__utility/forward.h> +#include <optional> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<class> + struct __join_view_iterator_category {}; + + template<class _View> + requires is_reference_v<range_reference_t<_View>> && + forward_range<_View> && + forward_range<range_reference_t<_View>> + struct __join_view_iterator_category<_View> { + using _OuterC = typename iterator_traits<iterator_t<_View>>::iterator_category; + using _InnerC = typename iterator_traits<iterator_t<range_reference_t<_View>>>::iterator_category; + + using iterator_category = _If< + derived_from<_OuterC, bidirectional_iterator_tag> && derived_from<_InnerC, bidirectional_iterator_tag>, + bidirectional_iterator_tag, + _If< + derived_from<_OuterC, forward_iterator_tag> && derived_from<_InnerC, forward_iterator_tag>, + forward_iterator_tag, + input_iterator_tag + > + >; + }; + + template<input_range _View> + requires view<_View> && input_range<range_reference_t<_View>> + class join_view + : public view_interface<join_view<_View>> { + private: + using _InnerRange = range_reference_t<_View>; + + template<bool> struct __iterator; + template<bool> struct __sentinel; + + static constexpr bool _UseCache = !is_reference_v<_InnerRange>; + using _Cache = _If<_UseCache, __non_propagating_cache<remove_cvref_t<_InnerRange>>, __empty_cache>; + _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cache_; + _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); + + public: + _LIBCPP_HIDE_FROM_ABI + join_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit join_view(_View __base) + : __base_(std::move(__base)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return std::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() { + constexpr bool __use_const = __simple_view<_View> && + is_reference_v<range_reference_t<_View>>; + return __iterator<__use_const>{*this, ranges::begin(__base_)}; + } + + template<class _V2 = _View> + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const + requires input_range<const _V2> && + is_reference_v<range_reference_t<const _V2>> + { + return __iterator<true>{*this, ranges::begin(__base_)}; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() { + if constexpr (forward_range<_View> && + is_reference_v<_InnerRange> && + forward_range<_InnerRange> && + common_range<_View> && + common_range<_InnerRange>) + return __iterator<__simple_view<_View>>{*this, ranges::end(__base_)}; + else + return __sentinel<__simple_view<_View>>{*this}; + } + + template<class _V2 = _View> + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const + requires input_range<const _V2> && + is_reference_v<range_reference_t<const _V2>> + { + using _ConstInnerRange = range_reference_t<const _View>; + if constexpr (forward_range<const _View> && + is_reference_v<_ConstInnerRange> && + forward_range<_ConstInnerRange> && + common_range<const _View> && + common_range<_ConstInnerRange>) { + return __iterator<true>{*this, ranges::end(__base_)}; + } else { + return __sentinel<true>{*this}; + } + } + }; + + template<input_range _View> + requires view<_View> && input_range<range_reference_t<_View>> + template<bool _Const> struct join_view<_View>::__sentinel { + template<bool> friend struct __sentinel; + + private: + using _Parent = __maybe_const<_Const, join_view>; + using _Base = __maybe_const<_Const, _View>; + sentinel_t<_Base> __end_ = sentinel_t<_Base>(); + + public: + _LIBCPP_HIDE_FROM_ABI + __sentinel() = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __sentinel(_Parent& __parent) + : __end_(ranges::end(__parent.__base_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel(__sentinel<!_Const> __s) + requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>> + : __end_(std::move(__s.__end_)) {} + + template<bool _OtherConst> + requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) { + return __x.__outer_ == __y.__end_; + } + }; + + template<input_range _View> + requires view<_View> && input_range<range_reference_t<_View>> + template<bool _Const> struct join_view<_View>::__iterator + : public __join_view_iterator_category<__maybe_const<_Const, _View>> { + + template<bool> friend struct __iterator; + + private: + using _Parent = __maybe_const<_Const, join_view>; + using _Base = __maybe_const<_Const, _View>; + using _Outer = iterator_t<_Base>; + using _Inner = iterator_t<range_reference_t<_Base>>; + + static constexpr bool __ref_is_glvalue = is_reference_v<range_reference_t<_Base>>; + + public: + _Outer __outer_ = _Outer(); + + private: + optional<_Inner> __inner_; + _Parent *__parent_ = nullptr; + + _LIBCPP_HIDE_FROM_ABI + constexpr void __satisfy() { + for (; __outer_ != ranges::end(__parent_->__base_); ++__outer_) { + auto&& __inner = [&]() -> auto&& { + if constexpr (__ref_is_glvalue) + return *__outer_; + else + return __parent_->__cache_.__emplace_from([&]() -> decltype(auto) { return *__outer_; }); + }(); + __inner_ = ranges::begin(__inner); + if (*__inner_ != ranges::end(__inner)) + return; + } + + if constexpr (__ref_is_glvalue) + __inner_.reset(); + } + + public: + using iterator_concept = _If< + __ref_is_glvalue && bidirectional_range<_Base> && bidirectional_range<range_reference_t<_Base>>, + bidirectional_iterator_tag, + _If< + __ref_is_glvalue && forward_range<_Base> && forward_range<range_reference_t<_Base>>, + forward_iterator_tag, + input_iterator_tag + > + >; + + using value_type = range_value_t<range_reference_t<_Base>>; + + using difference_type = common_type_t< + range_difference_t<_Base>, range_difference_t<range_reference_t<_Base>>>; + + _LIBCPP_HIDE_FROM_ABI + __iterator() requires default_initializable<_Outer> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator(_Parent& __parent, _Outer __outer) + : __outer_(std::move(__outer)) + , __parent_(std::addressof(__parent)) { + __satisfy(); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator(__iterator<!_Const> __i) + requires _Const && + convertible_to<iterator_t<_View>, _Outer> && + convertible_to<iterator_t<_InnerRange>, _Inner> + : __outer_(std::move(__i.__outer_)) + , __inner_(std::move(__i.__inner_)) + , __parent_(__i.__parent_) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator*() const { + return **__inner_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Inner operator->() const + requires __has_arrow<_Inner> && copyable<_Inner> + { + return *__inner_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator++() { + auto&& __inner = [&]() -> auto&& { + if constexpr (__ref_is_glvalue) + return *__outer_; + else + return *__parent_->__cache_; + }(); + if (++*__inner_ == ranges::end(__inner)) { + ++__outer_; + __satisfy(); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr void operator++(int) { + ++*this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator++(int) + requires __ref_is_glvalue && + forward_range<_Base> && + forward_range<range_reference_t<_Base>> + { + auto __tmp = *this; + ++*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator--() + requires __ref_is_glvalue && + bidirectional_range<_Base> && + bidirectional_range<range_reference_t<_Base>> && + common_range<range_reference_t<_Base>> + { + if (__outer_ == ranges::end(__parent_->__base_)) + __inner_ = ranges::end(*--__outer_); + + // Skip empty inner ranges when going backwards. + while (*__inner_ == ranges::begin(*__outer_)) { + __inner_ = ranges::end(*--__outer_); + } + + --*__inner_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator--(int) + requires __ref_is_glvalue && + bidirectional_range<_Base> && + bidirectional_range<range_reference_t<_Base>> && + common_range<range_reference_t<_Base>> + { + auto __tmp = *this; + --*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) + requires __ref_is_glvalue && + equality_comparable<iterator_t<_Base>> && + equality_comparable<iterator_t<range_reference_t<_Base>>> + { + return __x.__outer_ == __y.__outer_ && __x.__inner_ == __y.__inner_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr decltype(auto) iter_move(const __iterator& __i) + noexcept(noexcept(ranges::iter_move(*__i.__inner_))) + { + return ranges::iter_move(*__i.__inner_); + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr void iter_swap(const __iterator& __x, const __iterator& __y) + noexcept(noexcept(ranges::iter_swap(*__x.__inner_, *__y.__inner_))) + requires indirectly_swappable<_Inner> + { + return ranges::iter_swap(*__x.__inner_, *__y.__inner_); + } + }; + + template<class _Range> + explicit join_view(_Range&&) -> join_view<views::all_t<_Range>>; + +} // namespace ranges + +#undef _CONSTEXPR_TERNARY + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_JOIN_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h new file mode 100644 index 0000000000..30fcd9f11e --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h @@ -0,0 +1,114 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H +#define _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H + +#include <__config> +#include <__iterator/concepts.h> // indirectly_readable +#include <__iterator/iterator_traits.h> // iter_reference_t +#include <__memory/addressof.h> +#include <__utility/forward.h> +#include <concepts> // constructible_from +#include <optional> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + // __non_propagating_cache is a helper type that allows storing an optional value in it, + // but which does not copy the source's value when it is copy constructed/assigned to, + // and which resets the source's value when it is moved-from. + // + // This type is used as an implementation detail of some views that need to cache the + // result of `begin()` in order to provide an amortized O(1) begin() method. Typically, + // we don't want to propagate the value of the cache upon copy because the cached iterator + // may refer to internal details of the source view. + template<class _Tp> + requires is_object_v<_Tp> + class _LIBCPP_TEMPLATE_VIS __non_propagating_cache { + struct __from_tag { }; + struct __forward_tag { }; + + // This helper class is needed to perform copy and move elision when + // constructing the contained type from an iterator. + struct __wrapper { + template<class ..._Args> + constexpr explicit __wrapper(__forward_tag, _Args&& ...__args) : __t_(std::forward<_Args>(__args)...) { } + template<class _Fn> + constexpr explicit __wrapper(__from_tag, _Fn const& __f) : __t_(__f()) { } + _Tp __t_; + }; + + optional<__wrapper> __value_ = nullopt; + + public: + _LIBCPP_HIDE_FROM_ABI __non_propagating_cache() = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __non_propagating_cache(__non_propagating_cache const&) noexcept + : __value_(nullopt) + { } + + _LIBCPP_HIDE_FROM_ABI + constexpr __non_propagating_cache(__non_propagating_cache&& __other) noexcept + : __value_(nullopt) + { + __other.__value_.reset(); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __non_propagating_cache& operator=(__non_propagating_cache const& __other) noexcept { + if (this != std::addressof(__other)) { + __value_.reset(); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __non_propagating_cache& operator=(__non_propagating_cache&& __other) noexcept { + __value_.reset(); + __other.__value_.reset(); + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp& operator*() { return __value_->__t_; } + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp const& operator*() const { return __value_->__t_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr bool __has_value() const { return __value_.has_value(); } + + template<class _Fn> + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp& __emplace_from(_Fn const& __f) { + return __value_.emplace(__from_tag{}, __f).__t_; + } + + template<class ..._Args> + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp& __emplace(_Args&& ...__args) { + return __value_.emplace(__forward_tag{}, std::forward<_Args>(__args)...).__t_; + } + }; + + struct __empty_cache { }; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h new file mode 100644 index 0000000000..322152d7ca --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h @@ -0,0 +1,81 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_OWNING_VIEW_H +#define _LIBCPP___RANGES_OWNING_VIEW_H + +#include <__concepts/constructible.h> +#include <__concepts/movable.h> +#include <__config> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <__ranges/data.h> +#include <__ranges/empty.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<range _Rp> + requires movable<_Rp> && (!__is_std_initializer_list<remove_cvref_t<_Rp>>) + class owning_view : public view_interface<owning_view<_Rp>> { + _Rp __r_ = _Rp(); + +public: + owning_view() requires default_initializable<_Rp> = default; + _LIBCPP_HIDE_FROM_ABI constexpr owning_view(_Rp&& __r) : __r_(std::move(__r)) {} + + owning_view(owning_view&&) = default; + owning_view& operator=(owning_view&&) = default; + + _LIBCPP_HIDE_FROM_ABI constexpr _Rp& base() & noexcept { return __r_; } + _LIBCPP_HIDE_FROM_ABI constexpr const _Rp& base() const& noexcept { return __r_; } + _LIBCPP_HIDE_FROM_ABI constexpr _Rp&& base() && noexcept { return std::move(__r_); } + _LIBCPP_HIDE_FROM_ABI constexpr const _Rp&& base() const&& noexcept { return std::move(__r_); } + + _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Rp> begin() { return ranges::begin(__r_); } + _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Rp> end() { return ranges::end(__r_); } + _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const requires range<const _Rp> { return ranges::begin(__r_); } + _LIBCPP_HIDE_FROM_ABI constexpr auto end() const requires range<const _Rp> { return ranges::end(__r_); } + + _LIBCPP_HIDE_FROM_ABI constexpr bool empty() requires requires { ranges::empty(__r_); } + { return ranges::empty(__r_); } + _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const requires requires { ranges::empty(__r_); } + { return ranges::empty(__r_); } + + _LIBCPP_HIDE_FROM_ABI constexpr auto size() requires sized_range<_Rp> + { return ranges::size(__r_); } + _LIBCPP_HIDE_FROM_ABI constexpr auto size() const requires sized_range<const _Rp> + { return ranges::size(__r_); } + + _LIBCPP_HIDE_FROM_ABI constexpr auto data() requires contiguous_range<_Rp> + { return ranges::data(__r_); } + _LIBCPP_HIDE_FROM_ABI constexpr auto data() const requires contiguous_range<const _Rp> + { return ranges::data(__r_); } + }; + + template<class _Tp> + inline constexpr bool enable_borrowed_range<owning_view<_Tp>> = enable_borrowed_range<_Tp>; + +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_OWNING_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h new file mode 100644 index 0000000000..9b456b18f0 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h @@ -0,0 +1,73 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANGES_RANGE_ADAPTOR_H +#define _LIBCPP___RANGES_RANGE_ADAPTOR_H + +#include <__config> +#include <__functional/compose.h> +#include <__functional/invoke.h> +#include <__ranges/concepts.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// CRTP base that one can derive from in order to be considered a range adaptor closure +// by the library. When deriving from this class, a pipe operator will be provided to +// make the following hold: +// - `x | f` is equivalent to `f(x)` +// - `f1 | f2` is an adaptor closure `g` such that `g(x)` is equivalent to `f2(f1(x))` +template <class _Tp> +struct __range_adaptor_closure; + +// Type that wraps an arbitrary function object and makes it into a range adaptor closure, +// i.e. something that can be called via the `x | f` notation. +template <class _Fn> +struct __range_adaptor_closure_t : _Fn, __range_adaptor_closure<__range_adaptor_closure_t<_Fn>> { + constexpr explicit __range_adaptor_closure_t(_Fn&& __f) : _Fn(std::move(__f)) { } +}; + +template <class _Tp> +concept _RangeAdaptorClosure = derived_from<remove_cvref_t<_Tp>, __range_adaptor_closure<remove_cvref_t<_Tp>>>; + +template <class _Tp> +struct __range_adaptor_closure { + template <ranges::viewable_range _View, _RangeAdaptorClosure _Closure> + requires same_as<_Tp, remove_cvref_t<_Closure>> && + invocable<_Closure, _View> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + friend constexpr decltype(auto) operator|(_View&& __view, _Closure&& __closure) + noexcept(is_nothrow_invocable_v<_Closure, _View>) + { return std::invoke(std::forward<_Closure>(__closure), std::forward<_View>(__view)); } + + template <_RangeAdaptorClosure _Closure, _RangeAdaptorClosure _OtherClosure> + requires same_as<_Tp, remove_cvref_t<_Closure>> && + constructible_from<decay_t<_Closure>, _Closure> && + constructible_from<decay_t<_OtherClosure>, _OtherClosure> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + friend constexpr auto operator|(_Closure&& __c1, _OtherClosure&& __c2) + noexcept(is_nothrow_constructible_v<decay_t<_Closure>, _Closure> && + is_nothrow_constructible_v<decay_t<_OtherClosure>, _OtherClosure>) + { return __range_adaptor_closure_t(std::__compose(std::forward<_OtherClosure>(__c2), std::forward<_Closure>(__c1))); } +}; + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_RANGE_ADAPTOR_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h new file mode 100644 index 0000000000..cc4c0582cc --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h @@ -0,0 +1,130 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_RBEGIN_H +#define _LIBCPP___RANGES_RBEGIN_H + +#include <__concepts/class_or_enum.h> +#include <__concepts/same_as.h> +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/readable_traits.h> +#include <__iterator/reverse_iterator.h> +#include <__ranges/access.h> +#include <__utility/auto_cast.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [ranges.access.rbegin] + +namespace ranges { +namespace __rbegin { +template <class _Tp> +concept __member_rbegin = + __can_borrow<_Tp> && + __workaround_52970<_Tp> && + requires(_Tp&& __t) { + { _LIBCPP_AUTO_CAST(__t.rbegin()) } -> input_or_output_iterator; + }; + +void rbegin(auto&) = delete; +void rbegin(const auto&) = delete; + +template <class _Tp> +concept __unqualified_rbegin = + !__member_rbegin<_Tp> && + __can_borrow<_Tp> && + __class_or_enum<remove_cvref_t<_Tp>> && + requires(_Tp&& __t) { + { _LIBCPP_AUTO_CAST(rbegin(__t)) } -> input_or_output_iterator; + }; + +template <class _Tp> +concept __can_reverse = + __can_borrow<_Tp> && + !__member_rbegin<_Tp> && + !__unqualified_rbegin<_Tp> && + requires(_Tp&& __t) { + { ranges::begin(__t) } -> same_as<decltype(ranges::end(__t))>; + { ranges::begin(__t) } -> bidirectional_iterator; + }; + +struct __fn { + template <class _Tp> + requires __member_rbegin<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rbegin()))) + { + return _LIBCPP_AUTO_CAST(__t.rbegin()); + } + + template <class _Tp> + requires __unqualified_rbegin<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_LIBCPP_AUTO_CAST(rbegin(__t)))) + { + return _LIBCPP_AUTO_CAST(rbegin(__t)); + } + + template <class _Tp> + requires __can_reverse<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::end(__t))) + { + return std::make_reverse_iterator(ranges::end(__t)); + } + + void operator()(auto&&) const = delete; +}; +} // namespace __rbegin + +inline namespace __cpo { + inline constexpr auto rbegin = __rbegin::__fn{}; +} // namespace __cpo +} // namespace ranges + +// [range.access.crbegin] + +namespace ranges { +namespace __crbegin { +struct __fn { + template <class _Tp> + requires is_lvalue_reference_v<_Tp&&> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t)))) + -> decltype( ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t))) + { return ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t)); } + + template <class _Tp> + requires is_rvalue_reference_v<_Tp&&> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::rbegin(static_cast<const _Tp&&>(__t)))) + -> decltype( ranges::rbegin(static_cast<const _Tp&&>(__t))) + { return ranges::rbegin(static_cast<const _Tp&&>(__t)); } +}; +} // namespace __crbegin + +inline namespace __cpo { + inline constexpr auto crbegin = __crbegin::__fn{}; +} // namespace __cpo +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_RBEGIN_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h new file mode 100644 index 0000000000..90fb5c1832 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h @@ -0,0 +1,86 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_REF_VIEW_H +#define _LIBCPP___RANGES_REF_VIEW_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <__ranges/data.h> +#include <__ranges/empty.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<range _Range> + requires is_object_v<_Range> + class ref_view : public view_interface<ref_view<_Range>> { + _Range *__range_; + + static void __fun(_Range&); + static void __fun(_Range&&) = delete; + +public: + template<class _Tp> + requires __different_from<_Tp, ref_view> && + convertible_to<_Tp, _Range&> && requires { __fun(declval<_Tp>()); } + _LIBCPP_HIDE_FROM_ABI + constexpr ref_view(_Tp&& __t) + : __range_(std::addressof(static_cast<_Range&>(std::forward<_Tp>(__t)))) + {} + + _LIBCPP_HIDE_FROM_ABI constexpr _Range& base() const { return *__range_; } + + _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Range> begin() const { return ranges::begin(*__range_); } + _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Range> end() const { return ranges::end(*__range_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr bool empty() const + requires requires { ranges::empty(*__range_); } + { return ranges::empty(*__range_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const + requires sized_range<_Range> + { return ranges::size(*__range_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto data() const + requires contiguous_range<_Range> + { return ranges::data(*__range_); } + }; + + template<class _Range> + ref_view(_Range&) -> ref_view<_Range>; + + template<class _Tp> + inline constexpr bool enable_borrowed_range<ref_view<_Tp>> = true; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_REF_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h new file mode 100644 index 0000000000..cd7826021d --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h @@ -0,0 +1,134 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_REND_H +#define _LIBCPP___RANGES_REND_H + +#include <__concepts/class_or_enum.h> +#include <__concepts/same_as.h> +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/readable_traits.h> +#include <__iterator/reverse_iterator.h> +#include <__ranges/access.h> +#include <__ranges/rbegin.h> +#include <__utility/auto_cast.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [range.access.rend] + +namespace ranges { +namespace __rend { +template <class _Tp> +concept __member_rend = + __can_borrow<_Tp> && + __workaround_52970<_Tp> && + requires(_Tp&& __t) { + ranges::rbegin(__t); + { _LIBCPP_AUTO_CAST(__t.rend()) } -> sentinel_for<decltype(ranges::rbegin(__t))>; + }; + +void rend(auto&) = delete; +void rend(const auto&) = delete; + +template <class _Tp> +concept __unqualified_rend = + !__member_rend<_Tp> && + __can_borrow<_Tp> && + __class_or_enum<remove_cvref_t<_Tp>> && + requires(_Tp&& __t) { + ranges::rbegin(__t); + { _LIBCPP_AUTO_CAST(rend(__t)) } -> sentinel_for<decltype(ranges::rbegin(__t))>; + }; + +template <class _Tp> +concept __can_reverse = + __can_borrow<_Tp> && + !__member_rend<_Tp> && + !__unqualified_rend<_Tp> && + requires(_Tp&& __t) { + { ranges::begin(__t) } -> same_as<decltype(ranges::end(__t))>; + { ranges::begin(__t) } -> bidirectional_iterator; + }; + +class __fn { +public: + template <class _Tp> + requires __member_rend<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rend()))) + { + return _LIBCPP_AUTO_CAST(__t.rend()); + } + + template <class _Tp> + requires __unqualified_rend<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_LIBCPP_AUTO_CAST(rend(__t)))) + { + return _LIBCPP_AUTO_CAST(rend(__t)); + } + + template <class _Tp> + requires __can_reverse<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::begin(__t))) + { + return std::make_reverse_iterator(ranges::begin(__t)); + } + + void operator()(auto&&) const = delete; +}; +} // namespace __rend + +inline namespace __cpo { + inline constexpr auto rend = __rend::__fn{}; +} // namespace __cpo +} // namespace ranges + +// [range.access.crend] + +namespace ranges { +namespace __crend { +struct __fn { + template <class _Tp> + requires is_lvalue_reference_v<_Tp&&> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t)))) + -> decltype( ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t))) + { return ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t)); } + + template <class _Tp> + requires is_rvalue_reference_v<_Tp&&> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::rend(static_cast<const _Tp&&>(__t)))) + -> decltype( ranges::rend(static_cast<const _Tp&&>(__t))) + { return ranges::rend(static_cast<const _Tp&&>(__t)); } +}; +} // namespace __crend + +inline namespace __cpo { + inline constexpr auto crend = __crend::__fn{}; +} // namespace __cpo +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_REND_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h new file mode 100644 index 0000000000..59b8289a23 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h @@ -0,0 +1,190 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_REVERSE_VIEW_H +#define _LIBCPP___RANGES_REVERSE_VIEW_H + +#include <__concepts/constructible.h> +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/next.h> +#include <__iterator/reverse_iterator.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/non_propagating_cache.h> +#include <__ranges/range_adaptor.h> +#include <__ranges/size.h> +#include <__ranges/subrange.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<view _View> + requires bidirectional_range<_View> + class reverse_view : public view_interface<reverse_view<_View>> { + // We cache begin() whenever ranges::next is not guaranteed O(1) to provide an + // amortized O(1) begin() method. + static constexpr bool _UseCache = !random_access_range<_View> && !common_range<_View>; + using _Cache = _If<_UseCache, __non_propagating_cache<reverse_iterator<iterator_t<_View>>>, __empty_cache>; + _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache(); + _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); + + public: + _LIBCPP_HIDE_FROM_ABI + reverse_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit reverse_view(_View __view) : __base_(std::move(__view)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return std::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr reverse_iterator<iterator_t<_View>> begin() { + if constexpr (_UseCache) + if (__cached_begin_.__has_value()) + return *__cached_begin_; + + auto __tmp = std::make_reverse_iterator(ranges::next(ranges::begin(__base_), ranges::end(__base_))); + if constexpr (_UseCache) + __cached_begin_.__emplace(__tmp); + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr reverse_iterator<iterator_t<_View>> begin() requires common_range<_View> { + return std::make_reverse_iterator(ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const requires common_range<const _View> { + return std::make_reverse_iterator(ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr reverse_iterator<iterator_t<_View>> end() { + return std::make_reverse_iterator(ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const requires common_range<const _View> { + return std::make_reverse_iterator(ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() requires sized_range<_View> { + return ranges::size(__base_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const requires sized_range<const _View> { + return ranges::size(__base_); + } + }; + + template<class _Range> + reverse_view(_Range&&) -> reverse_view<views::all_t<_Range>>; + + template<class _Tp> + inline constexpr bool enable_borrowed_range<reverse_view<_Tp>> = enable_borrowed_range<_Tp>; + + namespace views { + namespace __reverse { + template<class _Tp> + constexpr bool __is_reverse_view = false; + + template<class _Tp> + constexpr bool __is_reverse_view<reverse_view<_Tp>> = true; + + template<class _Tp> + constexpr bool __is_sized_reverse_subrange = false; + + template<class _Iter> + constexpr bool __is_sized_reverse_subrange<subrange<reverse_iterator<_Iter>, reverse_iterator<_Iter>, subrange_kind::sized>> = true; + + template<class _Tp> + constexpr bool __is_unsized_reverse_subrange = false; + + template<class _Iter, subrange_kind _Kind> + constexpr bool __is_unsized_reverse_subrange<subrange<reverse_iterator<_Iter>, reverse_iterator<_Iter>, _Kind>> = _Kind == subrange_kind::unsized; + + template<class _Tp> + struct __unwrapped_reverse_subrange { + using type = void; // avoid SFINAE-ing out the overload below -- let the concept requirements do it for better diagnostics + }; + + template<class _Iter, subrange_kind _Kind> + struct __unwrapped_reverse_subrange<subrange<reverse_iterator<_Iter>, reverse_iterator<_Iter>, _Kind>> { + using type = subrange<_Iter, _Iter, _Kind>; + }; + + struct __fn : __range_adaptor_closure<__fn> { + template<class _Range> + requires __is_reverse_view<remove_cvref_t<_Range>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(std::forward<_Range>(__range).base())) + -> decltype( std::forward<_Range>(__range).base()) + { return std::forward<_Range>(__range).base(); } + + template<class _Range, + class _UnwrappedSubrange = typename __unwrapped_reverse_subrange<remove_cvref_t<_Range>>::type> + requires __is_sized_reverse_subrange<remove_cvref_t<_Range>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(_UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size()))) + -> decltype( _UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size())) + { return _UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size()); } + + template<class _Range, + class _UnwrappedSubrange = typename __unwrapped_reverse_subrange<remove_cvref_t<_Range>>::type> + requires __is_unsized_reverse_subrange<remove_cvref_t<_Range>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(_UnwrappedSubrange(__range.end().base(), __range.begin().base()))) + -> decltype( _UnwrappedSubrange(__range.end().base(), __range.begin().base())) + { return _UnwrappedSubrange(__range.end().base(), __range.begin().base()); } + + template<class _Range> + requires (!__is_reverse_view<remove_cvref_t<_Range>> && + !__is_sized_reverse_subrange<remove_cvref_t<_Range>> && + !__is_unsized_reverse_subrange<remove_cvref_t<_Range>>) + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(reverse_view{std::forward<_Range>(__range)})) + -> decltype( reverse_view{std::forward<_Range>(__range)}) + { return reverse_view{std::forward<_Range>(__range)}; } + }; + } // namespace __reverse + + inline namespace __cpo { + inline constexpr auto reverse = __reverse::__fn{}; + } // namespace __cpo + } // namespace views +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_REVERSE_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h new file mode 100644 index 0000000000..5347b78da9 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h @@ -0,0 +1,81 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_SINGLE_VIEW_H +#define _LIBCPP___RANGES_SINGLE_VIEW_H + +#include <__config> +#include <__ranges/copyable_box.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <__utility/in_place.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<copy_constructible _Tp> + requires is_object_v<_Tp> + class single_view : public view_interface<single_view<_Tp>> { + __copyable_box<_Tp> __value_; + + public: + _LIBCPP_HIDE_FROM_ABI + single_view() requires default_initializable<_Tp> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit single_view(const _Tp& __t) : __value_(in_place, __t) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit single_view(_Tp&& __t) : __value_(in_place, std::move(__t)) {} + + template<class... _Args> + requires constructible_from<_Tp, _Args...> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit single_view(in_place_t, _Args&&... __args) + : __value_{in_place, std::forward<_Args>(__args)...} {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp* begin() noexcept { return data(); } + + _LIBCPP_HIDE_FROM_ABI + constexpr const _Tp* begin() const noexcept { return data(); } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp* end() noexcept { return data() + 1; } + + _LIBCPP_HIDE_FROM_ABI + constexpr const _Tp* end() const noexcept { return data() + 1; } + + _LIBCPP_HIDE_FROM_ABI + static constexpr size_t size() noexcept { return 1; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp* data() noexcept { return __value_.operator->(); } + + _LIBCPP_HIDE_FROM_ABI + constexpr const _Tp* data() const noexcept { return __value_.operator->(); } + }; + + template<class _Tp> + single_view(_Tp) -> single_view<_Tp>; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_SINGLE_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h new file mode 100644 index 0000000000..4593205aef --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h @@ -0,0 +1,289 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_SUBRANGE_H +#define _LIBCPP___RANGES_SUBRANGE_H + +#include <__concepts/constructible.h> +#include <__concepts/convertible_to.h> +#include <__concepts/copyable.h> +#include <__concepts/derived_from.h> +#include <__concepts/different_from.h> +#include <__config> +#include <__debug> +#include <__iterator/advance.h> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <__ranges/dangling.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__tuple> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<class _From, class _To> + concept __uses_nonqualification_pointer_conversion = + is_pointer_v<_From> && is_pointer_v<_To> && + !convertible_to<remove_pointer_t<_From>(*)[], remove_pointer_t<_To>(*)[]>; + + template<class _From, class _To> + concept __convertible_to_non_slicing = + convertible_to<_From, _To> && + !__uses_nonqualification_pointer_conversion<decay_t<_From>, decay_t<_To>>; + + template<class _Tp> + concept __pair_like = + !is_reference_v<_Tp> && requires(_Tp __t) { + typename tuple_size<_Tp>::type; // Ensures `tuple_size<T>` is complete. + requires derived_from<tuple_size<_Tp>, integral_constant<size_t, 2>>; + typename tuple_element_t<0, remove_const_t<_Tp>>; + typename tuple_element_t<1, remove_const_t<_Tp>>; + { std::get<0>(__t) } -> convertible_to<const tuple_element_t<0, _Tp>&>; + { std::get<1>(__t) } -> convertible_to<const tuple_element_t<1, _Tp>&>; + }; + + template<class _Pair, class _Iter, class _Sent> + concept __pair_like_convertible_from = + !range<_Pair> && __pair_like<_Pair> && + constructible_from<_Pair, _Iter, _Sent> && + __convertible_to_non_slicing<_Iter, tuple_element_t<0, _Pair>> && + convertible_to<_Sent, tuple_element_t<1, _Pair>>; + + enum class _LIBCPP_ENUM_VIS subrange_kind : bool { unsized, sized }; + + template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent = _Iter, + subrange_kind _Kind = sized_sentinel_for<_Sent, _Iter> + ? subrange_kind::sized + : subrange_kind::unsized> + requires (_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _Iter>) + class _LIBCPP_TEMPLATE_VIS subrange + : public view_interface<subrange<_Iter, _Sent, _Kind>> + { + private: + static constexpr bool _StoreSize = (_Kind == subrange_kind::sized && !sized_sentinel_for<_Sent, _Iter>); + static constexpr bool _MustProvideSizeAtConstruction = !_StoreSize; // just to improve compiler diagnostics + struct _Empty { constexpr _Empty(auto) noexcept { } }; + using _Size = conditional_t<_StoreSize, make_unsigned_t<iter_difference_t<_Iter>>, _Empty>; + _LIBCPP_NO_UNIQUE_ADDRESS _Iter __begin_ = _Iter(); + _LIBCPP_NO_UNIQUE_ADDRESS _Sent __end_ = _Sent(); + _LIBCPP_NO_UNIQUE_ADDRESS _Size __size_ = 0; + + public: + _LIBCPP_HIDE_FROM_ABI + subrange() requires default_initializable<_Iter> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent) + requires _MustProvideSizeAtConstruction + : __begin_(std::move(__iter)), __end_(std::move(__sent)) + { } + + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent, + make_unsigned_t<iter_difference_t<_Iter>> __n) + requires (_Kind == subrange_kind::sized) + : __begin_(std::move(__iter)), __end_(std::move(__sent)), __size_(__n) + { + if constexpr (sized_sentinel_for<_Sent, _Iter>) + _LIBCPP_ASSERT((__end_ - __begin_) == static_cast<iter_difference_t<_Iter>>(__n), + "std::ranges::subrange was passed an invalid size hint"); + } + + template<__different_from<subrange> _Range> + requires borrowed_range<_Range> && + __convertible_to_non_slicing<iterator_t<_Range>, _Iter> && + convertible_to<sentinel_t<_Range>, _Sent> + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(_Range&& __range) + requires (!_StoreSize) + : subrange(ranges::begin(__range), ranges::end(__range)) + { } + + template<__different_from<subrange> _Range> + requires borrowed_range<_Range> && + __convertible_to_non_slicing<iterator_t<_Range>, _Iter> && + convertible_to<sentinel_t<_Range>, _Sent> + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(_Range&& __range) + requires _StoreSize && sized_range<_Range> + : subrange(__range, ranges::size(__range)) + { } + + template<borrowed_range _Range> + requires __convertible_to_non_slicing<iterator_t<_Range>, _Iter> && + convertible_to<sentinel_t<_Range>, _Sent> + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(_Range&& __range, make_unsigned_t<iter_difference_t<_Iter>> __n) + requires (_Kind == subrange_kind::sized) + : subrange(ranges::begin(__range), ranges::end(__range), __n) + { } + + template<__different_from<subrange> _Pair> + requires __pair_like_convertible_from<_Pair, const _Iter&, const _Sent&> + _LIBCPP_HIDE_FROM_ABI + constexpr operator _Pair() const { + return _Pair(__begin_, __end_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Iter begin() const requires copyable<_Iter> { + return __begin_; + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter begin() requires (!copyable<_Iter>) { + return std::move(__begin_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Sent end() const { + return __end_; + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const { + return __begin_ == __end_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr make_unsigned_t<iter_difference_t<_Iter>> size() const + requires (_Kind == subrange_kind::sized) + { + if constexpr (_StoreSize) + return __size_; + else + return std::__to_unsigned_like(__end_ - __begin_); + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) const& + requires forward_iterator<_Iter> + { + auto __tmp = *this; + __tmp.advance(__n); + return __tmp; + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) && { + advance(__n); + return std::move(*this); + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange prev(iter_difference_t<_Iter> __n = 1) const + requires bidirectional_iterator<_Iter> + { + auto __tmp = *this; + __tmp.advance(-__n); + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr subrange& advance(iter_difference_t<_Iter> __n) { + if constexpr (bidirectional_iterator<_Iter>) { + if (__n < 0) { + ranges::advance(__begin_, __n); + if constexpr (_StoreSize) + __size_ += std::__to_unsigned_like(-__n); + return *this; + } + } + + auto __d = __n - ranges::advance(__begin_, __n, __end_); + if constexpr (_StoreSize) + __size_ -= std::__to_unsigned_like(__d); + return *this; + } + }; + + template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent> + subrange(_Iter, _Sent) -> subrange<_Iter, _Sent>; + + template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent> + subrange(_Iter, _Sent, make_unsigned_t<iter_difference_t<_Iter>>) + -> subrange<_Iter, _Sent, subrange_kind::sized>; + + template<borrowed_range _Range> + subrange(_Range&&) -> subrange<iterator_t<_Range>, sentinel_t<_Range>, + (sized_range<_Range> || sized_sentinel_for<sentinel_t<_Range>, iterator_t<_Range>>) + ? subrange_kind::sized : subrange_kind::unsized>; + + template<borrowed_range _Range> + subrange(_Range&&, make_unsigned_t<range_difference_t<_Range>>) + -> subrange<iterator_t<_Range>, sentinel_t<_Range>, subrange_kind::sized>; + + template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind> + requires ((_Index == 0 && copyable<_Iter>) || _Index == 1) + _LIBCPP_HIDE_FROM_ABI + constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __subrange) { + if constexpr (_Index == 0) + return __subrange.begin(); + else + return __subrange.end(); + } + + template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind> + requires (_Index < 2) + _LIBCPP_HIDE_FROM_ABI + constexpr auto get(subrange<_Iter, _Sent, _Kind>&& __subrange) { + if constexpr (_Index == 0) + return __subrange.begin(); + else + return __subrange.end(); + } + + template<class _Ip, class _Sp, subrange_kind _Kp> + inline constexpr bool enable_borrowed_range<subrange<_Ip, _Sp, _Kp>> = true; + + template<range _Rp> + using borrowed_subrange_t = _If<borrowed_range<_Rp>, subrange<iterator_t<_Rp>>, dangling>; +} // namespace ranges + +// [range.subrange.general] + +using ranges::get; + +// [ranges.syn] + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_size<ranges::subrange<_Ip, _Sp, _Kp>> : integral_constant<size_t, 2> {}; + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_element<0, ranges::subrange<_Ip, _Sp, _Kp>> { + using type = _Ip; +}; + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_element<1, ranges::subrange<_Ip, _Sp, _Kp>> { + using type = _Sp; +}; + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_element<0, const ranges::subrange<_Ip, _Sp, _Kp>> { + using type = _Ip; +}; + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_element<1, const ranges::subrange<_Ip, _Sp, _Kp>> { + using type = _Sp; +}; + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_SUBRANGE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h new file mode 100644 index 0000000000..0b0f9c3744 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h @@ -0,0 +1,185 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_TAKE_VIEW_H +#define _LIBCPP___RANGES_TAKE_VIEW_H + +#include <__algorithm/min.h> +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/counted_iterator.h> +#include <__iterator/default_sentinel.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + template<view _View> + class take_view : public view_interface<take_view<_View>> { + _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); + range_difference_t<_View> __count_ = 0; + + template<bool> class __sentinel; + + public: + _LIBCPP_HIDE_FROM_ABI + take_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr take_view(_View __base, range_difference_t<_View> __count) + : __base_(std::move(__base)), __count_(__count) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return std::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() requires (!__simple_view<_View>) { + if constexpr (sized_range<_View>) { + if constexpr (random_access_range<_View>) { + return ranges::begin(__base_); + } else { + using _DifferenceT = range_difference_t<_View>; + auto __size = size(); + return counted_iterator(ranges::begin(__base_), static_cast<_DifferenceT>(__size)); + } + } else { + return counted_iterator(ranges::begin(__base_), __count_); + } + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const requires range<const _View> { + if constexpr (sized_range<const _View>) { + if constexpr (random_access_range<const _View>) { + return ranges::begin(__base_); + } else { + using _DifferenceT = range_difference_t<const _View>; + auto __size = size(); + return counted_iterator(ranges::begin(__base_), static_cast<_DifferenceT>(__size)); + } + } else { + return counted_iterator(ranges::begin(__base_), __count_); + } + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() requires (!__simple_view<_View>) { + if constexpr (sized_range<_View>) { + if constexpr (random_access_range<_View>) { + return ranges::begin(__base_) + size(); + } else { + return default_sentinel; + } + } else { + return __sentinel<false>{ranges::end(__base_)}; + } + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const requires range<const _View> { + if constexpr (sized_range<const _View>) { + if constexpr (random_access_range<const _View>) { + return ranges::begin(__base_) + size(); + } else { + return default_sentinel; + } + } else { + return __sentinel<true>{ranges::end(__base_)}; + } + } + + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() requires sized_range<_View> { + auto __n = ranges::size(__base_); + // TODO: use ranges::min here. + return std::min(__n, static_cast<decltype(__n)>(__count_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const requires sized_range<const _View> { + auto __n = ranges::size(__base_); + // TODO: use ranges::min here. + return std::min(__n, static_cast<decltype(__n)>(__count_)); + } + }; + + template<view _View> + template<bool _Const> + class take_view<_View>::__sentinel { + using _Base = __maybe_const<_Const, _View>; + template<bool _OtherConst> + using _Iter = counted_iterator<iterator_t<__maybe_const<_OtherConst, _View>>>; + _LIBCPP_NO_UNIQUE_ADDRESS sentinel_t<_Base> __end_ = sentinel_t<_Base>(); + + template<bool> + friend class take_view<_View>::__sentinel; + +public: + _LIBCPP_HIDE_FROM_ABI + __sentinel() = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(std::move(__end)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel(__sentinel<!_Const> __s) + requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>> + : __end_(std::move(__s.__end_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr sentinel_t<_Base> base() const { return __end_; } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) { + return __lhs.count() == 0 || __lhs.base() == __rhs.__end_; + } + + template<bool _OtherConst = !_Const> + requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) { + return __lhs.count() == 0 || __lhs.base() == __rhs.__end_; + } + }; + + template<class _Range> + take_view(_Range&&, range_difference_t<_Range>) -> take_view<views::all_t<_Range>>; + + template<class _Tp> + inline constexpr bool enable_borrowed_range<take_view<_Tp>> = enable_borrowed_range<_Tp>; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANGES_TAKE_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h new file mode 100644 index 0000000000..42ea1b82c7 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h @@ -0,0 +1,440 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_TRANSFORM_VIEW_H +#define _LIBCPP___RANGES_TRANSFORM_VIEW_H + +#include <__compare/three_way_comparable.h> +#include <__concepts/constructible.h> +#include <__concepts/convertible_to.h> +#include <__concepts/copyable.h> +#include <__concepts/derived_from.h> +#include <__concepts/equality_comparable.h> +#include <__concepts/invocable.h> +#include <__config> +#include <__functional/bind_back.h> +#include <__functional/invoke.h> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/copyable_box.h> +#include <__ranges/empty.h> +#include <__ranges/range_adaptor.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <__utility/in_place.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + +template<class _Fn, class _View> +concept __regular_invocable_with_range_ref = + regular_invocable<_Fn, range_reference_t<_View>>; + +template<class _View, class _Fn> +concept __transform_view_constraints = + view<_View> && is_object_v<_Fn> && + regular_invocable<_Fn&, range_reference_t<_View>> && + __can_reference<invoke_result_t<_Fn&, range_reference_t<_View>>>; + +template<input_range _View, copy_constructible _Fn> + requires __transform_view_constraints<_View, _Fn> +class transform_view : public view_interface<transform_view<_View, _Fn>> { + template<bool> class __iterator; + template<bool> class __sentinel; + + _LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Fn> __func_; + _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); + +public: + _LIBCPP_HIDE_FROM_ABI + transform_view() + requires default_initializable<_View> && default_initializable<_Fn> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr transform_view(_View __base, _Fn __func) + : __func_(std::in_place, std::move(__func)), __base_(std::move(__base)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return std::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator<false> begin() { + return __iterator<false>{*this, ranges::begin(__base_)}; + } + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator<true> begin() const + requires range<const _View> && + __regular_invocable_with_range_ref<const _Fn&, const _View> + { + return __iterator<true>(*this, ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel<false> end() { + return __sentinel<false>(ranges::end(__base_)); + } + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator<false> end() + requires common_range<_View> + { + return __iterator<false>(*this, ranges::end(__base_)); + } + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel<true> end() const + requires range<const _View> && + __regular_invocable_with_range_ref<const _Fn&, const _View> + { + return __sentinel<true>(ranges::end(__base_)); + } + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator<true> end() const + requires common_range<const _View> && + __regular_invocable_with_range_ref<const _Fn&, const _View> + { + return __iterator<true>(*this, ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() requires sized_range<_View> { return ranges::size(__base_); } + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const requires sized_range<const _View> { return ranges::size(__base_); } +}; + +template<class _Range, class _Fn> +transform_view(_Range&&, _Fn) -> transform_view<views::all_t<_Range>, _Fn>; + +template<class _View> +struct __transform_view_iterator_concept { using type = input_iterator_tag; }; + +template<random_access_range _View> +struct __transform_view_iterator_concept<_View> { using type = random_access_iterator_tag; }; + +template<bidirectional_range _View> +struct __transform_view_iterator_concept<_View> { using type = bidirectional_iterator_tag; }; + +template<forward_range _View> +struct __transform_view_iterator_concept<_View> { using type = forward_iterator_tag; }; + +template<class, class> +struct __transform_view_iterator_category_base {}; + +template<forward_range _View, class _Fn> +struct __transform_view_iterator_category_base<_View, _Fn> { + using _Cat = typename iterator_traits<iterator_t<_View>>::iterator_category; + + using iterator_category = conditional_t< + is_lvalue_reference_v<invoke_result_t<_Fn&, range_reference_t<_View>>>, + conditional_t< + derived_from<_Cat, contiguous_iterator_tag>, + random_access_iterator_tag, + _Cat + >, + input_iterator_tag + >; +}; + +template<input_range _View, copy_constructible _Fn> + requires __transform_view_constraints<_View, _Fn> +template<bool _Const> +class transform_view<_View, _Fn>::__iterator + : public __transform_view_iterator_category_base<_View, _Fn> { + + using _Parent = __maybe_const<_Const, transform_view>; + using _Base = __maybe_const<_Const, _View>; + + _Parent *__parent_ = nullptr; + + template<bool> + friend class transform_view<_View, _Fn>::__iterator; + + template<bool> + friend class transform_view<_View, _Fn>::__sentinel; + +public: + iterator_t<_Base> __current_ = iterator_t<_Base>(); + + using iterator_concept = typename __transform_view_iterator_concept<_View>::type; + using value_type = remove_cvref_t<invoke_result_t<_Fn&, range_reference_t<_Base>>>; + using difference_type = range_difference_t<_Base>; + + _LIBCPP_HIDE_FROM_ABI + __iterator() requires default_initializable<iterator_t<_Base>> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator(_Parent& __parent, iterator_t<_Base> __current) + : __parent_(std::addressof(__parent)), __current_(std::move(__current)) {} + + // Note: `__i` should always be `__iterator<false>`, but directly using + // `__iterator<false>` is ill-formed when `_Const` is false + // (see http://wg21.link/class.copy.ctor#5). + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator(__iterator<!_Const> __i) + requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>> + : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr const iterator_t<_Base>& base() const& noexcept { + return __current_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr iterator_t<_Base> base() && { + return std::move(__current_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator*() const + noexcept(noexcept(std::invoke(*__parent_->__func_, *__current_))) + { + return std::invoke(*__parent_->__func_, *__current_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator++() { + ++__current_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr void operator++(int) { ++__current_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator++(int) + requires forward_range<_Base> + { + auto __tmp = *this; + ++*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator--() + requires bidirectional_range<_Base> + { + --__current_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator--(int) + requires bidirectional_range<_Base> + { + auto __tmp = *this; + --*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator+=(difference_type __n) + requires random_access_range<_Base> + { + __current_ += __n; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator-=(difference_type __n) + requires random_access_range<_Base> + { + __current_ -= __n; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator[](difference_type __n) const + noexcept(noexcept(std::invoke(*__parent_->__func_, __current_[__n]))) + requires random_access_range<_Base> + { + return std::invoke(*__parent_->__func_, __current_[__n]); + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) + requires equality_comparable<iterator_t<_Base>> + { + return __x.__current_ == __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> + { + return __x.__current_ < __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> + { + return __x.__current_ > __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> + { + return __x.__current_ <= __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> + { + return __x.__current_ >= __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>> + { + return __x.__current_ <=> __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator+(__iterator __i, difference_type __n) + requires random_access_range<_Base> + { + return __iterator{*__i.__parent_, __i.__current_ + __n}; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator+(difference_type __n, __iterator __i) + requires random_access_range<_Base> + { + return __iterator{*__i.__parent_, __i.__current_ + __n}; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator-(__iterator __i, difference_type __n) + requires random_access_range<_Base> + { + return __iterator{*__i.__parent_, __i.__current_ - __n}; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y) + requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>> + { + return __x.__current_ - __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr decltype(auto) iter_move(const __iterator& __i) + noexcept(noexcept(*__i)) + { + if constexpr (is_lvalue_reference_v<decltype(*__i)>) + return std::move(*__i); + else + return *__i; + } +}; + +template<input_range _View, copy_constructible _Fn> + requires __transform_view_constraints<_View, _Fn> +template<bool _Const> +class transform_view<_View, _Fn>::__sentinel { + using _Parent = __maybe_const<_Const, transform_view>; + using _Base = __maybe_const<_Const, _View>; + + sentinel_t<_Base> __end_ = sentinel_t<_Base>(); + + template<bool> + friend class transform_view<_View, _Fn>::__iterator; + + template<bool> + friend class transform_view<_View, _Fn>::__sentinel; + +public: + _LIBCPP_HIDE_FROM_ABI + __sentinel() = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(__end) {} + + // Note: `__i` should always be `__sentinel<false>`, but directly using + // `__sentinel<false>` is ill-formed when `_Const` is false + // (see http://wg21.link/class.copy.ctor#5). + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel(__sentinel<!_Const> __i) + requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>> + : __end_(std::move(__i.__end_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr sentinel_t<_Base> base() const { return __end_; } + + template<bool _OtherConst> + requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) { + return __x.__current_ == __y.__end_; + } + + template<bool _OtherConst> + requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>> + operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) { + return __x.__current_ - __y.__end_; + } + + template<bool _OtherConst> + requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>> + operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) { + return __x.__end_ - __y.__current_; + } +}; + +namespace views { +namespace __transform { + struct __fn { + template<class _Range, class _Fn> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range, _Fn&& __f) const + noexcept(noexcept(transform_view(std::forward<_Range>(__range), std::forward<_Fn>(__f)))) + -> decltype( transform_view(std::forward<_Range>(__range), std::forward<_Fn>(__f))) + { return transform_view(std::forward<_Range>(__range), std::forward<_Fn>(__f)); } + + template<class _Fn> + requires constructible_from<decay_t<_Fn>, _Fn> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Fn&& __f) const + noexcept(is_nothrow_constructible_v<decay_t<_Fn>, _Fn>) + { return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Fn>(__f))); } + }; +} // namespace __transform + +inline namespace __cpo { + inline constexpr auto transform = __transform::__fn{}; +} // namespace __cpo +} // namespace views + +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_TRANSFORM_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h new file mode 100644 index 0000000000..91ae4bde7d --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h @@ -0,0 +1,195 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_VIEW_INTERFACE_H +#define _LIBCPP___RANGES_VIEW_INTERFACE_H + +#include <__config> +#include <__debug> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/prev.h> +#include <__memory/pointer_traits.h> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <__ranges/empty.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace ranges { + +template<class _Tp> +concept __can_empty = requires(_Tp __t) { ranges::empty(__t); }; + +template<class _Tp> +void __implicitly_convert_to(type_identity_t<_Tp>) noexcept; + +template<class _Derived> + requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>> +class view_interface { + _LIBCPP_HIDE_FROM_ABI + constexpr _Derived& __derived() noexcept { + static_assert(sizeof(_Derived) && derived_from<_Derived, view_interface> && view<_Derived>); + return static_cast<_Derived&>(*this); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Derived const& __derived() const noexcept { + static_assert(sizeof(_Derived) && derived_from<_Derived, view_interface> && view<_Derived>); + return static_cast<_Derived const&>(*this); + } + +public: + template<class _D2 = _Derived> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() + noexcept(noexcept(__implicitly_convert_to<bool>(ranges::begin(__derived()) == ranges::end(__derived())))) + requires forward_range<_D2> + { + return ranges::begin(__derived()) == ranges::end(__derived()); + } + + template<class _D2 = _Derived> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const + noexcept(noexcept(__implicitly_convert_to<bool>(ranges::begin(__derived()) == ranges::end(__derived())))) + requires forward_range<const _D2> + { + return ranges::begin(__derived()) == ranges::end(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit operator bool() + noexcept(noexcept(ranges::empty(declval<_D2>()))) + requires __can_empty<_D2> + { + return !ranges::empty(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit operator bool() const + noexcept(noexcept(ranges::empty(declval<const _D2>()))) + requires __can_empty<const _D2> + { + return !ranges::empty(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr auto data() + noexcept(noexcept(std::to_address(ranges::begin(__derived())))) + requires contiguous_iterator<iterator_t<_D2>> + { + return std::to_address(ranges::begin(__derived())); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr auto data() const + noexcept(noexcept(std::to_address(ranges::begin(__derived())))) + requires range<const _D2> && contiguous_iterator<iterator_t<const _D2>> + { + return std::to_address(ranges::begin(__derived())); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() + noexcept(noexcept(ranges::end(__derived()) - ranges::begin(__derived()))) + requires forward_range<_D2> + && sized_sentinel_for<sentinel_t<_D2>, iterator_t<_D2>> + { + return ranges::end(__derived()) - ranges::begin(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const + noexcept(noexcept(ranges::end(__derived()) - ranges::begin(__derived()))) + requires forward_range<const _D2> + && sized_sentinel_for<sentinel_t<const _D2>, iterator_t<const _D2>> + { + return ranges::end(__derived()) - ranges::begin(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) front() + noexcept(noexcept(*ranges::begin(__derived()))) + requires forward_range<_D2> + { + _LIBCPP_ASSERT(!empty(), + "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); + return *ranges::begin(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) front() const + noexcept(noexcept(*ranges::begin(__derived()))) + requires forward_range<const _D2> + { + _LIBCPP_ASSERT(!empty(), + "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); + return *ranges::begin(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) back() + noexcept(noexcept(*ranges::prev(ranges::end(__derived())))) + requires bidirectional_range<_D2> && common_range<_D2> + { + _LIBCPP_ASSERT(!empty(), + "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); + return *ranges::prev(ranges::end(__derived())); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) back() const + noexcept(noexcept(*ranges::prev(ranges::end(__derived())))) + requires bidirectional_range<const _D2> && common_range<const _D2> + { + _LIBCPP_ASSERT(!empty(), + "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); + return *ranges::prev(ranges::end(__derived())); + } + + template<random_access_range _RARange = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) + noexcept(noexcept(ranges::begin(__derived())[__index])) + { + return ranges::begin(__derived())[__index]; + } + + template<random_access_range _RARange = const _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) const + noexcept(noexcept(ranges::begin(__derived())[__index])) + { + return ranges::begin(__derived())[__index]; + } +}; + +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_VIEW_INTERFACE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h new file mode 100644 index 0000000000..8cc5ba3d2a --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h @@ -0,0 +1,35 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANGES_VIEWS +#define _LIBCPP___RANGES_VIEWS + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) + +namespace ranges { + +namespace views { } + +} // namespace ranges + +namespace views = ranges::views; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_VIEWS diff --git a/contrib/libs/cxxsupp/libcxx/include/ranges b/contrib/libs/cxxsupp/libcxx/include/ranges new file mode 100644 index 0000000000..2bc9121cd6 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/ranges @@ -0,0 +1,275 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_RANGES +#define _LIBCPP_RANGES + +/* + +#include <compare> // see [compare.syn] +#include <initializer_list> // see [initializer.list.syn] +#include <iterator> // see [iterator.synopsis] + +namespace std::ranges { + inline namespace unspecified { + // [range.access], range access + inline constexpr unspecified begin = unspecified; + inline constexpr unspecified end = unspecified; + inline constexpr unspecified cbegin = unspecified; + inline constexpr unspecified cend = unspecified; + + inline constexpr unspecified size = unspecified; + inline constexpr unspecified ssize = unspecified; + } + + // [range.range], ranges + template<class T> + concept range = see below; + + template<class T> + inline constexpr bool enable_borrowed_range = false; + + template<class T> + using iterator_t = decltype(ranges::begin(declval<T&>())); + template<range R> + using sentinel_t = decltype(ranges::end(declval<R&>())); + template<range R> + using range_difference_t = iter_difference_t<iterator_t<R>>; + template<sized_range R> + using range_size_t = decltype(ranges::size(declval<R&>())); + template<range R> + using range_value_t = iter_value_t<iterator_t<R>>; + template<range R> + using range_reference_t = iter_reference_t<iterator_t<R>>; + template<range R> + using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>; + + // [range.sized], sized ranges + template<class> + inline constexpr bool disable_sized_range = false; + + template<class T> + concept sized_range = ...; + + // [range.view], views + template<class T> + inline constexpr bool enable_view = ...; + + struct view_base { }; + + template<class T> + concept view = ...; + + // [range.refinements], other range refinements + template<class R, class T> + concept output_range = see below; + + template<class T> + concept input_range = see below; + + template<class T> + concept forward_range = see below; + + template<class T> + concept bidirectional_range = see below; + + template<class T> + concept random_access_range = see below; + + template<class T> + concept contiguous_range = see below; + + template <class _Tp> + concept common_range = see below; + + template<class T> + concept viewable_range = see below; + + // [view.interface], class template view_interface + template<class D> + requires is_class_v<D> && same_as<D, remove_cv_t<D>> + class view_interface; + + // [range.subrange], sub-ranges + enum class subrange_kind : bool { unsized, sized }; + + template<input_or_output_iterator I, sentinel_for<I> S = I, subrange_kind K = see below> + requires (K == subrange_kind::sized || !sized_sentinel_for<S, I>) + class subrange; + + template<class I, class S, subrange_kind K> + inline constexpr bool enable_borrowed_range<subrange<I, S, K>> = true; + + // [range.dangling], dangling iterator handling + struct dangling; + + template<range R> + using borrowed_iterator_t = see below; + + template<range R> + using borrowed_subrange_t = see below; + + // [range.empty], empty view + template<class T> + requires is_object_v<T> + class empty_view; + + // [range.all], all view + namespace views { + inline constexpr unspecified all = unspecified; + + template<viewable_range R> + using all_t = decltype(all(declval<R>())); + } + + template<range R> + requires is_object_v<R> + class ref_view; + + template<class T> + inline constexpr bool enable_borrowed_range<ref_view<T>> = true; + + template<range R> + requires see below + class owning_view; + + template<class T> + inline constexpr bool enable_borrowed_range<owning_view<T>> = enable_borrowed_range<T>; + + // [range.drop], drop view + template<view V> + class drop_view; + + template<class T> + inline constexpr bool enable_borrowed_range<drop_view<T>> = enable_borrowed_range<T>; + + // [range.transform], transform view + template<input_range V, copy_constructible F> + requires view<V> && is_object_v<F> && + regular_invocable<F&, range_reference_t<V>> && + can-reference<invoke_result_t<F&, range_reference_t<V>>> + class transform_view; + + // [range.counted], counted view + namespace views { inline constexpr unspecified counted = unspecified; } + + // [range.common], common view + template<view V> + requires (!common_range<V> && copyable<iterator_t<V>>) + class common_view; + + // [range.reverse], reverse view + template<view V> + requires bidirectional_range<V> + class reverse_view; + + template<class T> + inline constexpr bool enable_borrowed_range<reverse_view<T>> = enable_borrowed_range<T>; + + template<class T> + inline constexpr bool enable_borrowed_range<common_view<T>> = enable_borrowed_range<T>; + + // [range.take], take view + template<view> class take_view; + + template<class T> + inline constexpr bool enable_borrowed_range<take_view<T>> = enable_borrowed_range<T>; + + template<copy_constructible T> + requires is_object_v<T> + class single_view; + + template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> + requires weakly-equality-comparable-with<W, Bound> && copyable<W> + class iota_view; + + template<class W, class Bound> + inline constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true; + + // [range.join], join view + template<input_range V> + requires view<V> && input_range<range_reference_t<V>> + class join_view; +} + +namespace std { + namespace views = ranges::views; + + template<class T> struct tuple_size; + template<size_t I, class T> struct tuple_element; + + template<class I, class S, ranges::subrange_kind K> + struct tuple_size<ranges::subrange<I, S, K>> + : integral_constant<size_t, 2> {}; + + template<class I, class S, ranges::subrange_kind K> + struct tuple_element<0, ranges::subrange<I, S, K>> { + using type = I; + }; + + template<class I, class S, ranges::subrange_kind K> + struct tuple_element<1, ranges::subrange<I, S, K>> { + using type = S; + }; + + template<class I, class S, ranges::subrange_kind K> + struct tuple_element<0, const ranges::subrange<I, S, K>> { + using type = I; + }; + + template<class I, class S, ranges::subrange_kind K> + struct tuple_element<1, const ranges::subrange<I, S, K>> { + using type = S; + }; +} +*/ + +// Make sure all feature-test macros are available. +#include <version> +// Enable the contents of the header only when libc++ was built with LIBCXX_ENABLE_INCOMPLETE_FEATURES. +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) + +#include <__config> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/common_view.h> +#include <__ranges/concepts.h> +#include <__ranges/counted.h> +#include <__ranges/dangling.h> +#include <__ranges/data.h> +#include <__ranges/drop_view.h> +#include <__ranges/empty.h> +#include <__ranges/empty_view.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/enable_view.h> +#include <__ranges/iota_view.h> +#include <__ranges/join_view.h> +#include <__ranges/rbegin.h> +#include <__ranges/ref_view.h> +#include <__ranges/rend.h> +#include <__ranges/reverse_view.h> +#include <__ranges/single_view.h> +#include <__ranges/size.h> +#include <__ranges/subrange.h> +#include <__ranges/take_view.h> +#include <__ranges/transform_view.h> +#include <__ranges/view_interface.h> +#include <__ranges/views.h> +#include <compare> // Required by the standard. +#include <initializer_list> // Required by the standard. +#include <iterator> // Required by the standard. +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) + +#endif // _LIBCPP_RANGES diff --git a/contrib/libs/expat/CMakeLists.txt b/contrib/libs/expat/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/expat/CMakeLists.txt +++ b/contrib/libs/expat/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/farmhash/CMakeLists.txt b/contrib/libs/farmhash/CMakeLists.txt index 948de22915..28ba97595e 100644 --- a/contrib/libs/farmhash/CMakeLists.txt +++ b/contrib/libs/farmhash/CMakeLists.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(arch) add_library(contrib-libs-farmhash) target_compile_options(contrib-libs-farmhash PRIVATE diff --git a/contrib/libs/farmhash/arch/CMakeLists.txt b/contrib/libs/farmhash/arch/CMakeLists.txt new file mode 100644 index 0000000000..8a05f09d4b --- /dev/null +++ b/contrib/libs/farmhash/arch/CMakeLists.txt @@ -0,0 +1,11 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(sse41) +add_subdirectory(sse42) +add_subdirectory(sse42_aesni) diff --git a/contrib/libs/grpc/CMakeLists.txt b/contrib/libs/grpc/CMakeLists.txt index b53da127bc..4f25d8832f 100644 --- a/contrib/libs/grpc/CMakeLists.txt +++ b/contrib/libs/grpc/CMakeLists.txt @@ -6,6 +6,10 @@ # original buildsystem will not be accepted. +add_subdirectory(grpc) +add_subdirectory(grpc++) +add_subdirectory(src) +add_subdirectory(third_party) add_library(contrib-libs-grpc INTERFACE) target_link_libraries(contrib-libs-grpc INTERFACE diff --git a/contrib/libs/grpc/src/CMakeLists.txt b/contrib/libs/grpc/src/CMakeLists.txt new file mode 100644 index 0000000000..e78afa34c8 --- /dev/null +++ b/contrib/libs/grpc/src/CMakeLists.txt @@ -0,0 +1,10 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(compiler) +add_subdirectory(core) diff --git a/contrib/libs/grpc/src/compiler/CMakeLists.txt b/contrib/libs/grpc/src/compiler/CMakeLists.txt new file mode 100644 index 0000000000..0a445ac050 --- /dev/null +++ b/contrib/libs/grpc/src/compiler/CMakeLists.txt @@ -0,0 +1,9 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(grpc_plugin_support) diff --git a/contrib/libs/grpc/src/core/CMakeLists.txt b/contrib/libs/grpc/src/core/CMakeLists.txt new file mode 100644 index 0000000000..0396db380f --- /dev/null +++ b/contrib/libs/grpc/src/core/CMakeLists.txt @@ -0,0 +1,9 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(lib) diff --git a/contrib/libs/grpc/third_party/CMakeLists.txt b/contrib/libs/grpc/third_party/CMakeLists.txt new file mode 100644 index 0000000000..450719d3ba --- /dev/null +++ b/contrib/libs/grpc/third_party/CMakeLists.txt @@ -0,0 +1,10 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(address_sorting) +add_subdirectory(upb) diff --git a/contrib/libs/highwayhash/CMakeLists.txt b/contrib/libs/highwayhash/CMakeLists.txt index 52a595a707..b8b5c58b9f 100644 --- a/contrib/libs/highwayhash/CMakeLists.txt +++ b/contrib/libs/highwayhash/CMakeLists.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(arch) add_library(contrib-libs-highwayhash) target_compile_options(contrib-libs-highwayhash PRIVATE diff --git a/contrib/libs/highwayhash/arch/CMakeLists.txt b/contrib/libs/highwayhash/arch/CMakeLists.txt new file mode 100644 index 0000000000..fc6e7a4a0e --- /dev/null +++ b/contrib/libs/highwayhash/arch/CMakeLists.txt @@ -0,0 +1,10 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(avx2) +add_subdirectory(sse41) diff --git a/contrib/libs/hyperscan/CMakeLists.txt b/contrib/libs/hyperscan/CMakeLists.txt index a7a2cc5e5a..ce01188f26 100644 --- a/contrib/libs/hyperscan/CMakeLists.txt +++ b/contrib/libs/hyperscan/CMakeLists.txt @@ -6,6 +6,10 @@ # original buildsystem will not be accepted. +add_subdirectory(runtime_avx2) +add_subdirectory(runtime_avx512) +add_subdirectory(runtime_core2) +add_subdirectory(runtime_corei7) add_library(contrib-libs-hyperscan) target_compile_options(contrib-libs-hyperscan PRIVATE diff --git a/contrib/libs/icu/CMakeLists.txt b/contrib/libs/icu/CMakeLists.txt new file mode 100644 index 0000000000..e637671c46 --- /dev/null +++ b/contrib/libs/icu/CMakeLists.txt @@ -0,0 +1,475 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(contrib-libs-icu) +target_compile_options(contrib-libs-icu PRIVATE + -DU_COMMON_IMPLEMENTATION + -DU_I18N_IMPLEMENTATION + -DU_IO_IMPLEMENTATION + -DU_STATIC_IMPLEMENTATION + -std=c++17 +) +target_include_directories(contrib-libs-icu PUBLIC + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/include +) +target_include_directories(contrib-libs-icu PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io +) +target_link_libraries(contrib-libs-icu PUBLIC + contrib-libs-cxxsupp +) +target_sources(contrib-libs-icu PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/appendable.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/bmpset.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/brkeng.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/brkiter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/bytesinkutil.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/bytestream.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/bytestrie.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/bytestriebuilder.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/bytestrieiterator.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/caniter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/characterproperties.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/chariter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/charstr.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/cmemory.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/cstr.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/cstring.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/cwchar.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/dictbe.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/dictionarydata.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/dtintrv.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/edits.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/errorcode.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/filteredbrk.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/filterednormalizer2.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/icudataver.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/icuplug.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/loadednormalizer2impl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/localebuilder.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/localematcher.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/localeprioritylist.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/locavailable.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/locbased.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/locdispnames.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/locdistance.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/locdspnm.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/locid.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/loclikely.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/loclikelysubtags.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/locmap.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/locresdata.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/locutil.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/lsr.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/messagepattern.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/normalizer2.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/normalizer2impl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/normlzr.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/parsepos.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/patternprops.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/pluralmap.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/propname.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/propsvec.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/punycode.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/putil.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/rbbi.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/rbbi_cache.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/rbbidata.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/rbbinode.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/rbbirb.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/rbbiscan.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/rbbisetb.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/rbbistbl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/rbbitblb.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/resbund.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/resbund_cnv.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/resource.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/restrace.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ruleiter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/schriter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/serv.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/servlk.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/servlkf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/servls.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/servnotf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/servrbf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/servslkf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/sharedobject.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/simpleformatter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/static_unicode_sets.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/stringpiece.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/stringtriebuilder.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uarrsort.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ubidi.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ubidi_props.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ubidiln.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ubiditransform.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ubidiwrt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ubrk.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucase.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucasemap.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucasemap_titlecase_brkiter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucat.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uchar.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucharstrie.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucharstriebuilder.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucharstrieiterator.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uchriter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucln_cmn.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucmndata.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv2022.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_bld.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_cb.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_cnv.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_ct.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_err.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_ext.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_io.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_lmb.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_set.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_u16.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_u32.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_u7.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnv_u8.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnvbocu.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnvdisp.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnvhz.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnvisci.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnvlat1.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnvmbcs.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnvscsu.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucnvsel.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucol_swp.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucptrie.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ucurr.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/udata.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/udatamem.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/udataswp.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uenum.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uhash.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uhash_us.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uidna.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uinit.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uinvchar.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uiter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ulist.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uloc.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uloc_keytype.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uloc_tag.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/umapfile.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/umath.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/umutablecptrie.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/umutex.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unames.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unifiedcache.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unifilt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unifunct.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uniset.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uniset_closure.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uniset_props.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unisetspan.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unistr.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unistr_case.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unistr_case_locale.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unistr_cnv.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unistr_props.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unistr_titlecase_brkiter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unorm.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/unormcmp.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uobject.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uprops.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ures_cnv.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uresbund.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uresdata.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/usc_impl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uscript.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uscript_props.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uset.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uset_props.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/usetiter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ushape.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/usprep.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustack.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustr_cnv.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustr_titlecase_brkiter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustr_wcs.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustrcase.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustrcase_locale.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustrenum.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustrfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustring.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/ustrtrns.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/utext.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/utf_impl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/util.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/util_props.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/utrace.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/utrie.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/utrie2.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/utrie2_builder.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/utrie_swap.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uts46.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/utypes.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uvector.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uvectr32.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/uvectr64.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/common/wintz.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/alphaindex.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/anytrans.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/astro.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/basictz.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/bocsu.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/brktrans.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/buddhcal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/calendar.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/casetrn.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/cecal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/chnsecal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/choicfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/coleitr.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/coll.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collation.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationbuilder.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationcompare.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationdata.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationdatabuilder.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationdatareader.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationdatawriter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationfastlatin.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationfastlatinbuilder.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationfcd.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationiterator.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationkeys.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationroot.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationrootelements.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationruleparser.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationsets.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationsettings.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationtailoring.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/collationweights.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/compactdecimalformat.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/coptccal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/cpdtrans.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/csdetect.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/csmatch.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/csr2022.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/csrecog.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/csrmbcs.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/csrsbcs.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/csrucode.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/csrutf8.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/curramt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/currfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/currpinf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/currunit.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/dangical.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/datefmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/dayperiodrules.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/dcfmtsym.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/decContext.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/decNumber.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/decimfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/double-conversion-bignum-dtoa.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/double-conversion-bignum.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/double-conversion-cached-powers.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/double-conversion-double-to-string.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/double-conversion-fast-dtoa.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/double-conversion-string-to-double.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/double-conversion-strtod.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/dtfmtsym.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/dtitvfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/dtitvinf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/dtptngen.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/dtrule.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/erarules.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/esctrn.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ethpccal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/fmtable.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/fmtable_cnv.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/format.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/formatted_string_builder.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/formattedval_iterimpl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/formattedval_sbimpl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/formattedvalue.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/fphdlimp.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/fpositer.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/funcrepl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/gender.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/gregocal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/gregoimp.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/hebrwcal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/indiancal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/inputext.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/islamcal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/japancal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/listformatter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/measfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/measunit.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/measunit_extra.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/measure.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/msgfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/name2uni.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/nfrs.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/nfrule.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/nfsubs.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/nortrans.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/nounit.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/nultrans.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_affixutils.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_asformat.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_capi.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_compact.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_currencysymbols.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_decimalquantity.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_decimfmtprops.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_fluent.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_formatimpl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_grouping.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_integerwidth.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_longnames.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_mapper.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_modifiers.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_multiplier.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_notation.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_output.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_padding.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_patternmodifier.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_patternstring.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_rounding.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_scientific.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_skeletons.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/number_utils.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numparse_affixes.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numparse_compositions.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numparse_currency.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numparse_decimal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numparse_impl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numparse_parsednumber.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numparse_scientific.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numparse_symbols.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numparse_validators.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numrange_fluent.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numrange_impl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/numsys.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/olsontz.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/persncal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/plurfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/plurrule.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/quant.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/quantityformatter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/rbnf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/rbt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/rbt_data.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/rbt_pars.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/rbt_rule.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/rbt_set.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/rbtz.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/regexcmp.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/regeximp.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/regexst.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/regextxt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/region.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/reldatefmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/reldtfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/rematch.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/remtrans.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/repattrn.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/rulebasedcollator.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/scientificnumberformatter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/scriptset.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/search.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/selfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/sharedbreakiterator.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/simpletz.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/smpdtfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/smpdtfst.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/sortkey.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/standardplural.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/string_segment.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/strmatch.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/strrepl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/stsearch.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/taiwncal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/timezone.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/titletrn.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tmunit.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tmutamt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tmutfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tolowtrn.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/toupptrn.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/translit.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/transreg.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tridpars.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tzfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tzgnames.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tznames.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tznames_impl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tzrule.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/tztrans.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ucal.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ucln_in.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ucol.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ucol_res.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ucol_sit.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ucoleitr.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ucsdet.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/udat.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/udateintervalformat.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/udatpg.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ufieldpositer.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/uitercollationiterator.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ulistformatter.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ulocdata.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/umsg.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/unesctrn.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/uni2name.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/unum.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/unumsys.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/upluralrules.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/uregex.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/uregexc.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/uregion.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/usearch.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/uspoof.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/uspoof_build.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/uspoof_conf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/uspoof_impl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/utf16collationiterator.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/utf8collationiterator.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/utmscale.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/utrans.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/vtzone.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/vzone.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/windtfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/winnmfmt.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/wintzimpl.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/zonemeta.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/zrule.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/i18n/ztrans.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/locbund.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/sprintf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/sscanf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/ucln_io.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/ufile.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/ufmt_cmn.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/uprintf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/uprntf_p.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/uscanf.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/uscanf_p.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/ustdio.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/io/ustream.cpp +) +target_rodata_sources(contrib-libs-icu + PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/libs/icu/icudt67_dat.rodata +) diff --git a/contrib/libs/jemalloc/CMakeLists.txt b/contrib/libs/jemalloc/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/jemalloc/CMakeLists.txt +++ b/contrib/libs/jemalloc/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/libc_compat/CMakeLists.txt b/contrib/libs/libc_compat/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/libc_compat/CMakeLists.txt +++ b/contrib/libs/libc_compat/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/libevent/CMakeLists.txt b/contrib/libs/libevent/CMakeLists.txt index 8f682d4097..1090ce426d 100644 --- a/contrib/libs/libevent/CMakeLists.txt +++ b/contrib/libs/libevent/CMakeLists.txt @@ -6,6 +6,10 @@ # original buildsystem will not be accepted. +add_subdirectory(event_core) +add_subdirectory(event_extra) +add_subdirectory(event_openssl) +add_subdirectory(event_thread) add_library(contrib-libs-libevent INTERFACE) target_include_directories(contrib-libs-libevent INTERFACE diff --git a/contrib/libs/libevent/event_core/CMakeLists.txt b/contrib/libs/libevent/event_core/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/libevent/event_core/CMakeLists.txt +++ b/contrib/libs/libevent/event_core/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/libunwind/CMakeLists.txt b/contrib/libs/libunwind/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/libunwind/CMakeLists.txt +++ b/contrib/libs/libunwind/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/linuxvdso/CMakeLists.linux.txt b/contrib/libs/linuxvdso/CMakeLists.linux.txt index 1a9a6ed70c..c9d397538d 100644 --- a/contrib/libs/linuxvdso/CMakeLists.linux.txt +++ b/contrib/libs/linuxvdso/CMakeLists.linux.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(original) add_library(contrib-libs-linuxvdso) target_link_libraries(contrib-libs-linuxvdso PUBLIC diff --git a/contrib/libs/linuxvdso/CMakeLists.txt b/contrib/libs/linuxvdso/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/linuxvdso/CMakeLists.txt +++ b/contrib/libs/linuxvdso/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/linuxvdso/original/CMakeLists.txt b/contrib/libs/linuxvdso/original/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/linuxvdso/original/CMakeLists.txt +++ b/contrib/libs/linuxvdso/original/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/llvm12/CMakeLists.txt b/contrib/libs/llvm12/CMakeLists.txt index e664110afd..ee668ea149 100644 --- a/contrib/libs/llvm12/CMakeLists.txt +++ b/contrib/libs/llvm12/CMakeLists.txt @@ -6,6 +6,9 @@ # original buildsystem will not be accepted. +add_subdirectory(include) +add_subdirectory(lib) +add_subdirectory(utils) add_library(contrib-libs-llvm12 INTERFACE) target_include_directories(contrib-libs-llvm12 INTERFACE diff --git a/contrib/libs/llvm12/include/epilogue.cmake b/contrib/libs/llvm12/include/epilogue.cmake deleted file mode 100644 index a35e76c107..0000000000 --- a/contrib/libs/llvm12/include/epilogue.cmake +++ /dev/null @@ -1,3 +0,0 @@ -add_custom_target(OpenMP-gen-srcs-stealing - DEPENDS ${CMAKE_BINARY_DIR}/contrib/libs/llvm12/lib/Frontend/OpenMP/OMP.cpp -) diff --git a/contrib/libs/llvm12/lib/Bitcode/CMakeLists.txt b/contrib/libs/llvm12/lib/Bitcode/CMakeLists.txt new file mode 100644 index 0000000000..2c4b89cdf6 --- /dev/null +++ b/contrib/libs/llvm12/lib/Bitcode/CMakeLists.txt @@ -0,0 +1,10 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(Reader) +add_subdirectory(Writer) diff --git a/contrib/libs/llvm12/lib/Bitstream/CMakeLists.txt b/contrib/libs/llvm12/lib/Bitstream/CMakeLists.txt new file mode 100644 index 0000000000..cd07ec46be --- /dev/null +++ b/contrib/libs/llvm12/lib/Bitstream/CMakeLists.txt @@ -0,0 +1,9 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(Reader) diff --git a/contrib/libs/llvm12/lib/CMakeLists.txt b/contrib/libs/llvm12/lib/CMakeLists.txt new file mode 100644 index 0000000000..7eb0a3dec9 --- /dev/null +++ b/contrib/libs/llvm12/lib/CMakeLists.txt @@ -0,0 +1,30 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(Analysis) +add_subdirectory(AsmParser) +add_subdirectory(BinaryFormat) +add_subdirectory(Bitcode) +add_subdirectory(Bitstream) +add_subdirectory(CodeGen) +add_subdirectory(DebugInfo) +add_subdirectory(Demangle) +add_subdirectory(ExecutionEngine) +add_subdirectory(Frontend) +add_subdirectory(IR) +add_subdirectory(IRReader) +add_subdirectory(Linker) +add_subdirectory(MC) +add_subdirectory(Object) +add_subdirectory(ProfileData) +add_subdirectory(Remarks) +add_subdirectory(Support) +add_subdirectory(TableGen) +add_subdirectory(Target) +add_subdirectory(TextAPI) +add_subdirectory(Transforms) diff --git a/contrib/libs/llvm12/lib/CodeGen/CMakeLists.txt b/contrib/libs/llvm12/lib/CodeGen/CMakeLists.txt index e9be0827ee..1fa45f425d 100644 --- a/contrib/libs/llvm12/lib/CodeGen/CMakeLists.txt +++ b/contrib/libs/llvm12/lib/CodeGen/CMakeLists.txt @@ -6,6 +6,9 @@ # original buildsystem will not be accepted. +add_subdirectory(AsmPrinter) +add_subdirectory(GlobalISel) +add_subdirectory(SelectionDAG) add_library(llvm12-lib-CodeGen) target_compile_options(llvm12-lib-CodeGen PRIVATE diff --git a/contrib/libs/llvm12/lib/DebugInfo/CMakeLists.txt b/contrib/libs/llvm12/lib/DebugInfo/CMakeLists.txt new file mode 100644 index 0000000000..865d0ebbff --- /dev/null +++ b/contrib/libs/llvm12/lib/DebugInfo/CMakeLists.txt @@ -0,0 +1,13 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(CodeView) +add_subdirectory(DWARF) +add_subdirectory(MSF) +add_subdirectory(PDB) +add_subdirectory(Symbolize) diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.darwin.txt b/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.darwin.txt new file mode 100644 index 0000000000..40aae59a90 --- /dev/null +++ b/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.darwin.txt @@ -0,0 +1,36 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(MCJIT) +add_subdirectory(RuntimeDyld) + +add_library(llvm12-lib-ExecutionEngine) +target_compile_options(llvm12-lib-ExecutionEngine PRIVATE + -Wno-everything +) +target_include_directories(llvm12-lib-ExecutionEngine PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine +) +target_link_libraries(llvm12-lib-ExecutionEngine PUBLIC + contrib-libs-cxxsupp + contrib-libs-llvm12 + libs-llvm12-include + lib-ExecutionEngine-RuntimeDyld + llvm12-lib-IR + llvm12-lib-MC + llvm12-lib-Object + llvm12-lib-Support + llvm12-lib-Target +) +target_sources(llvm12-lib-ExecutionEngine PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngine.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngineBindings.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/GDBRegistrationListener.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/SectionMemoryManager.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/TargetSelect.cpp +) diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.linux.txt b/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.linux.txt new file mode 100644 index 0000000000..74965dc236 --- /dev/null +++ b/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.linux.txt @@ -0,0 +1,37 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(MCJIT) +add_subdirectory(PerfJITEvents) +add_subdirectory(RuntimeDyld) + +add_library(llvm12-lib-ExecutionEngine) +target_compile_options(llvm12-lib-ExecutionEngine PRIVATE + -Wno-everything +) +target_include_directories(llvm12-lib-ExecutionEngine PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine +) +target_link_libraries(llvm12-lib-ExecutionEngine PUBLIC + contrib-libs-cxxsupp + contrib-libs-llvm12 + libs-llvm12-include + lib-ExecutionEngine-RuntimeDyld + llvm12-lib-IR + llvm12-lib-MC + llvm12-lib-Object + llvm12-lib-Support + llvm12-lib-Target +) +target_sources(llvm12-lib-ExecutionEngine PRIVATE + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngine.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngineBindings.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/GDBRegistrationListener.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/SectionMemoryManager.cpp + ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/TargetSelect.cpp +) diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.txt b/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.txt index e26a6ef664..dbfe6fa2c4 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.txt +++ b/contrib/libs/llvm12/lib/ExecutionEngine/CMakeLists.txt @@ -6,29 +6,8 @@ # original buildsystem will not be accepted. - -add_library(llvm12-lib-ExecutionEngine) -target_compile_options(llvm12-lib-ExecutionEngine PRIVATE - -Wno-everything -) -target_include_directories(llvm12-lib-ExecutionEngine PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine -) -target_link_libraries(llvm12-lib-ExecutionEngine PUBLIC - contrib-libs-cxxsupp - contrib-libs-llvm12 - libs-llvm12-include - lib-ExecutionEngine-RuntimeDyld - llvm12-lib-IR - llvm12-lib-MC - llvm12-lib-Object - llvm12-lib-Support - llvm12-lib-Target -) -target_sources(llvm12-lib-ExecutionEngine PRIVATE - ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngine.cpp - ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngineBindings.cpp - ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/GDBRegistrationListener.cpp - ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/SectionMemoryManager.cpp - ${CMAKE_SOURCE_DIR}/contrib/libs/llvm12/lib/ExecutionEngine/TargetSelect.cpp -) +if (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) + include(CMakeLists.linux.txt) +endif() diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt b/contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt +++ b/contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/llvm12/lib/Frontend/CMakeLists.txt b/contrib/libs/llvm12/lib/Frontend/CMakeLists.txt new file mode 100644 index 0000000000..8c1b874e3c --- /dev/null +++ b/contrib/libs/llvm12/lib/Frontend/CMakeLists.txt @@ -0,0 +1,9 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(OpenMP) diff --git a/contrib/libs/llvm12/lib/Frontend/OpenMP/epilogue.cmake b/contrib/libs/llvm12/lib/Frontend/OpenMP/epilogue.cmake deleted file mode 100644 index 571389aff2..0000000000 --- a/contrib/libs/llvm12/lib/Frontend/OpenMP/epilogue.cmake +++ /dev/null @@ -1,2 +0,0 @@ - -add_dependencies(lib-Frontend-OpenMP OpenMP-gen-srcs-stealing) diff --git a/contrib/libs/llvm12/lib/Frontend/OpenMP/prologue.cmake b/contrib/libs/llvm12/lib/Frontend/OpenMP/prologue.cmake deleted file mode 100644 index 3ddc6f594c..0000000000 --- a/contrib/libs/llvm12/lib/Frontend/OpenMP/prologue.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set_property(SOURCE ${CMAKE_BINARY_DIR}/contrib/libs/llvm12/lib/Frontend/OpenMP/OMP.cpp - PROPERTY GENERATED On -) diff --git a/contrib/libs/llvm12/lib/MC/CMakeLists.txt b/contrib/libs/llvm12/lib/MC/CMakeLists.txt index e30f70c19b..9daf06006e 100644 --- a/contrib/libs/llvm12/lib/MC/CMakeLists.txt +++ b/contrib/libs/llvm12/lib/MC/CMakeLists.txt @@ -6,6 +6,8 @@ # original buildsystem will not be accepted. +add_subdirectory(MCDisassembler) +add_subdirectory(MCParser) add_library(llvm12-lib-MC) target_compile_options(llvm12-lib-MC PRIVATE diff --git a/contrib/libs/llvm12/lib/Target/CMakeLists.txt b/contrib/libs/llvm12/lib/Target/CMakeLists.txt index 0506e18714..a2d54963f0 100644 --- a/contrib/libs/llvm12/lib/Target/CMakeLists.txt +++ b/contrib/libs/llvm12/lib/Target/CMakeLists.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(X86) add_library(llvm12-lib-Target) target_compile_options(llvm12-lib-Target PRIVATE diff --git a/contrib/libs/llvm12/lib/Target/X86/CMakeLists.txt b/contrib/libs/llvm12/lib/Target/X86/CMakeLists.txt index 82de35d9e8..ed1fc6d50e 100644 --- a/contrib/libs/llvm12/lib/Target/X86/CMakeLists.txt +++ b/contrib/libs/llvm12/lib/Target/X86/CMakeLists.txt @@ -6,6 +6,10 @@ # original buildsystem will not be accepted. +add_subdirectory(AsmParser) +add_subdirectory(Disassembler) +add_subdirectory(MCTargetDesc) +add_subdirectory(TargetInfo) add_library(lib-Target-X86) target_compile_options(lib-Target-X86 PRIVATE diff --git a/contrib/libs/llvm12/lib/TextAPI/CMakeLists.txt b/contrib/libs/llvm12/lib/TextAPI/CMakeLists.txt new file mode 100644 index 0000000000..e510446281 --- /dev/null +++ b/contrib/libs/llvm12/lib/TextAPI/CMakeLists.txt @@ -0,0 +1,9 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(MachO) diff --git a/contrib/libs/llvm12/lib/Transforms/CMakeLists.txt b/contrib/libs/llvm12/lib/Transforms/CMakeLists.txt new file mode 100644 index 0000000000..bc8c9460d5 --- /dev/null +++ b/contrib/libs/llvm12/lib/Transforms/CMakeLists.txt @@ -0,0 +1,17 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(AggressiveInstCombine) +add_subdirectory(CFGuard) +add_subdirectory(IPO) +add_subdirectory(InstCombine) +add_subdirectory(Instrumentation) +add_subdirectory(ObjCARC) +add_subdirectory(Scalar) +add_subdirectory(Utils) +add_subdirectory(Vectorize) diff --git a/contrib/libs/llvm12/utils/CMakeLists.txt b/contrib/libs/llvm12/utils/CMakeLists.txt new file mode 100644 index 0000000000..96eb85cbfb --- /dev/null +++ b/contrib/libs/llvm12/utils/CMakeLists.txt @@ -0,0 +1,9 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(TableGen) diff --git a/contrib/libs/llvm12/utils/TableGen/CMakeLists.darwin.txt b/contrib/libs/llvm12/utils/TableGen/CMakeLists.darwin.txt index fbd169466f..a90cbd7db3 100644 --- a/contrib/libs/llvm12/utils/TableGen/CMakeLists.darwin.txt +++ b/contrib/libs/llvm12/utils/TableGen/CMakeLists.darwin.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(GlobalISel) add_executable(llvm-tblgen) target_compile_options(llvm-tblgen PRIVATE diff --git a/contrib/libs/llvm12/utils/TableGen/CMakeLists.linux.txt b/contrib/libs/llvm12/utils/TableGen/CMakeLists.linux.txt index b21240ea2f..8482d8f5bc 100644 --- a/contrib/libs/llvm12/utils/TableGen/CMakeLists.linux.txt +++ b/contrib/libs/llvm12/utils/TableGen/CMakeLists.linux.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(GlobalISel) add_executable(llvm-tblgen) target_compile_options(llvm-tblgen PRIVATE diff --git a/contrib/libs/llvm12/utils/TableGen/CMakeLists.txt b/contrib/libs/llvm12/utils/TableGen/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/llvm12/utils/TableGen/CMakeLists.txt +++ b/contrib/libs/llvm12/utils/TableGen/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/lz4/CMakeLists.txt b/contrib/libs/lz4/CMakeLists.txt index 183471d07e..b73d70e8af 100644 --- a/contrib/libs/lz4/CMakeLists.txt +++ b/contrib/libs/lz4/CMakeLists.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(generated) add_library(contrib-libs-lz4) target_include_directories(contrib-libs-lz4 PRIVATE diff --git a/contrib/libs/lzma/CMakeLists.txt b/contrib/libs/lzma/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/lzma/CMakeLists.txt +++ b/contrib/libs/lzma/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/nayuki_md5/CMakeLists.txt b/contrib/libs/nayuki_md5/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/contrib/libs/nayuki_md5/CMakeLists.txt +++ b/contrib/libs/nayuki_md5/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/pcre/CMakeLists.txt b/contrib/libs/pcre/CMakeLists.txt index 8c18cb2e24..93c0fd5ad0 100644 --- a/contrib/libs/pcre/CMakeLists.txt +++ b/contrib/libs/pcre/CMakeLists.txt @@ -6,6 +6,8 @@ # original buildsystem will not be accepted. +add_subdirectory(pcre16) +add_subdirectory(pcre32) add_library(contrib-libs-pcre) target_compile_options(contrib-libs-pcre PUBLIC diff --git a/contrib/libs/pdqsort/CMakeLists.txt b/contrib/libs/pdqsort/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/pdqsort/CMakeLists.txt +++ b/contrib/libs/pdqsort/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/poco/CMakeLists.linux.txt b/contrib/libs/poco/CMakeLists.linux.txt new file mode 100644 index 0000000000..5ad2ad4720 --- /dev/null +++ b/contrib/libs/poco/CMakeLists.linux.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(Crypto) +add_subdirectory(Foundation) +add_subdirectory(JSON) +add_subdirectory(Net) +add_subdirectory(NetSSL_OpenSSL) +add_subdirectory(Util) +add_subdirectory(XML) diff --git a/contrib/libs/poco/CMakeLists.txt b/contrib/libs/poco/CMakeLists.txt new file mode 100644 index 0000000000..97368e369c --- /dev/null +++ b/contrib/libs/poco/CMakeLists.txt @@ -0,0 +1,11 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) + include(CMakeLists.linux.txt) +endif() diff --git a/contrib/libs/poco/Crypto/CMakeLists.txt b/contrib/libs/poco/Crypto/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/poco/Crypto/CMakeLists.txt +++ b/contrib/libs/poco/Crypto/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/poco/Foundation/CMakeLists.txt b/contrib/libs/poco/Foundation/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/poco/Foundation/CMakeLists.txt +++ b/contrib/libs/poco/Foundation/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/poco/JSON/CMakeLists.txt b/contrib/libs/poco/JSON/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/poco/JSON/CMakeLists.txt +++ b/contrib/libs/poco/JSON/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/poco/Net/CMakeLists.txt b/contrib/libs/poco/Net/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/poco/Net/CMakeLists.txt +++ b/contrib/libs/poco/Net/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/poco/NetSSL_OpenSSL/CMakeLists.txt b/contrib/libs/poco/NetSSL_OpenSSL/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/poco/NetSSL_OpenSSL/CMakeLists.txt +++ b/contrib/libs/poco/NetSSL_OpenSSL/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/poco/Util/CMakeLists.txt b/contrib/libs/poco/Util/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/poco/Util/CMakeLists.txt +++ b/contrib/libs/poco/Util/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/poco/XML/CMakeLists.txt b/contrib/libs/poco/XML/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/poco/XML/CMakeLists.txt +++ b/contrib/libs/poco/XML/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/protobuf_std/src/google/protobuf/util/time_util.h b/contrib/libs/protobuf_std/src/google/protobuf/util/time_util.h deleted file mode 100644 index 96b1aac46b..0000000000 --- a/contrib/libs/protobuf_std/src/google/protobuf/util/time_util.h +++ /dev/null @@ -1,313 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Defines utilities for the Timestamp and Duration well known types. - -#ifndef GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__ -#define GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__ - -#include <cstdint> -#include <ctime> -#include <ostream> -#include <string> -#ifdef _MSC_VER -#ifdef _XBOX_ONE -struct timeval { - int64 tv_sec; /* seconds */ - int64 tv_usec; /* and microseconds */ -}; -#else -#include <winsock2.h> -#endif // _XBOX_ONE -#else -#include <sys/time.h> -#endif - -#include <google/protobuf/duration.pb.h> -#include <google/protobuf/timestamp.pb.h> - -#include <google/protobuf/port_def.inc> - -namespace google { -namespace protobuf { -namespace util { - -// Utility functions for Timestamp and Duration. -class PROTOBUF_EXPORT TimeUtil { - typedef google::protobuf::Timestamp Timestamp; - typedef google::protobuf::Duration Duration; - - public: - // The min/max Timestamp/Duration values we support. - // - // For "0001-01-01T00:00:00Z". - static const int64_t kTimestampMinSeconds = -62135596800LL; - // For "9999-12-31T23:59:59.999999999Z". - static const int64_t kTimestampMaxSeconds = 253402300799LL; - static const int64_t kDurationMinSeconds = -315576000000LL; - static const int64_t kDurationMaxSeconds = 315576000000LL; - - // Converts Timestamp to/from RFC 3339 date string format. - // Generated output will always be Z-normalized and uses 3, 6 or 9 - // fractional digits as required to represent the exact time. When - // parsing, any fractional digits (or none) and any offset are - // accepted as long as they fit into nano-seconds precision. - // Note that Timestamp can only represent time from - // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. Converting - // a Timestamp outside of this range is undefined behavior. - // See https://www.ietf.org/rfc/rfc3339.txt - // - // Example of generated format: - // "1972-01-01T10:00:20.021Z" - // - // Example of accepted format: - // "1972-01-01T10:00:20.021-05:00" - static std::string ToString(const Timestamp& timestamp); - static bool FromString(const std::string& value, Timestamp* timestamp); - - // Converts Duration to/from string format. The string format will contains - // 3, 6, or 9 fractional digits depending on the precision required to - // represent the exact Duration value. For example: - // "1s", "1.010s", "1.000000100s", "-3.100s" - // The range that can be represented by Duration is from -315,576,000,000 - // to +315,576,000,000 inclusive (in seconds). - static std::string ToString(const Duration& duration); - static bool FromString(const std::string& value, Duration* timestamp); - -#ifdef GetCurrentTime -#undef GetCurrentTime // Visual Studio has macro GetCurrentTime -#endif - // Gets the current UTC time. - static Timestamp GetCurrentTime(); - // Returns the Time representing "1970-01-01 00:00:00". - static Timestamp GetEpoch(); - - // Converts between Duration and integer types. The behavior is undefined if - // the input value is not in the valid range of Duration. - static Duration NanosecondsToDuration(int64_t nanos); - static Duration MicrosecondsToDuration(int64_t micros); - static Duration MillisecondsToDuration(int64_t millis); - static Duration SecondsToDuration(int64_t seconds); - static Duration MinutesToDuration(int64_t minutes); - static Duration HoursToDuration(int64_t hours); - // Result will be truncated towards zero. For example, "-1.5s" will be - // truncated to "-1s", and "1.5s" to "1s" when converting to seconds. - // It's undefined behavior if the input duration is not valid or the result - // exceeds the range of int64. A duration is not valid if it's not in the - // valid range of Duration, or have an invalid nanos value (i.e., larger - // than 999999999, less than -999999999, or have a different sign from the - // seconds part). - static int64_t DurationToNanoseconds(const Duration& duration); - static int64_t DurationToMicroseconds(const Duration& duration); - static int64_t DurationToMilliseconds(const Duration& duration); - static int64_t DurationToSeconds(const Duration& duration); - static int64_t DurationToMinutes(const Duration& duration); - static int64_t DurationToHours(const Duration& duration); - // Creates Timestamp from integer types. The integer value indicates the - // time elapsed from Epoch time. The behavior is undefined if the input - // value is not in the valid range of Timestamp. - static Timestamp NanosecondsToTimestamp(int64_t nanos); - static Timestamp MicrosecondsToTimestamp(int64_t micros); - static Timestamp MillisecondsToTimestamp(int64_t millis); - static Timestamp SecondsToTimestamp(int64_t seconds); - // Result will be truncated down to the nearest integer value. For example, - // with "1969-12-31T23:59:59.9Z", TimestampToMilliseconds() returns -100 - // and TimestampToSeconds() returns -1. It's undefined behavior if the input - // Timestamp is not valid (i.e., its seconds part or nanos part does not fall - // in the valid range) or the return value doesn't fit into int64. - static int64_t TimestampToNanoseconds(const Timestamp& timestamp); - static int64_t TimestampToMicroseconds(const Timestamp& timestamp); - static int64_t TimestampToMilliseconds(const Timestamp& timestamp); - static int64_t TimestampToSeconds(const Timestamp& timestamp); - - // Conversion to/from other time/date types. Note that these types may - // have a different precision and time range from Timestamp/Duration. - // When converting to a lower precision type, the value will be truncated - // to the nearest value that can be represented. If the value is - // out of the range of the result type, the return value is undefined. - // - // Conversion to/from time_t - static Timestamp TimeTToTimestamp(time_t value); - static time_t TimestampToTimeT(const Timestamp& value); - - // Conversion to/from timeval - static Timestamp TimevalToTimestamp(const timeval& value); - static timeval TimestampToTimeval(const Timestamp& value); - static Duration TimevalToDuration(const timeval& value); - static timeval DurationToTimeval(const Duration& value); -}; - -} // namespace util -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -// Overloaded operators for Duration. -// -// Assignment operators. -PROTOBUF_EXPORT Duration& operator+=(Duration& d1, - const Duration& d2); // NOLINT -PROTOBUF_EXPORT Duration& operator-=(Duration& d1, - const Duration& d2); // NOLINT -PROTOBUF_EXPORT Duration& operator*=(Duration& d, int64_t r); // NOLINT -PROTOBUF_EXPORT Duration& operator*=(Duration& d, double r); // NOLINT -PROTOBUF_EXPORT Duration& operator/=(Duration& d, int64_t r); // NOLINT -PROTOBUF_EXPORT Duration& operator/=(Duration& d, double r); // NOLINT -// Overload for other integer types. -template <typename T> -Duration& operator*=(Duration& d, T r) { // NOLINT - int64_t x = r; - return d *= x; -} -template <typename T> -Duration& operator/=(Duration& d, T r) { // NOLINT - int64_t x = r; - return d /= x; -} -PROTOBUF_EXPORT Duration& operator%=(Duration& d1, - const Duration& d2); // NOLINT -// Relational operators. -inline bool operator<(const Duration& d1, const Duration& d2) { - if (d1.seconds() == d2.seconds()) { - return d1.nanos() < d2.nanos(); - } - return d1.seconds() < d2.seconds(); -} -inline bool operator>(const Duration& d1, const Duration& d2) { - return d2 < d1; -} -inline bool operator>=(const Duration& d1, const Duration& d2) { - return !(d1 < d2); -} -inline bool operator<=(const Duration& d1, const Duration& d2) { - return !(d2 < d1); -} -inline bool operator==(const Duration& d1, const Duration& d2) { - return d1.seconds() == d2.seconds() && d1.nanos() == d2.nanos(); -} -inline bool operator!=(const Duration& d1, const Duration& d2) { - return !(d1 == d2); -} -// Additive operators -inline Duration operator-(const Duration& d) { - Duration result; - result.set_seconds(-d.seconds()); - result.set_nanos(-d.nanos()); - return result; -} -inline Duration operator+(const Duration& d1, const Duration& d2) { - Duration result = d1; - return result += d2; -} -inline Duration operator-(const Duration& d1, const Duration& d2) { - Duration result = d1; - return result -= d2; -} -// Multiplicative operators -template <typename T> -inline Duration operator*(Duration d, T r) { - return d *= r; -} -template <typename T> -inline Duration operator*(T r, Duration d) { - return d *= r; -} -template <typename T> -inline Duration operator/(Duration d, T r) { - return d /= r; -} -PROTOBUF_EXPORT int64_t operator/(const Duration& d1, const Duration& d2); - -inline Duration operator%(const Duration& d1, const Duration& d2) { - Duration result = d1; - return result %= d2; -} - -inline std::ostream& operator<<(std::ostream& out, const Duration& d) { - out << ::PROTOBUF_NAMESPACE_ID::util::TimeUtil::ToString(d); - return out; -} - -// Overloaded operators for Timestamp -// -// Assignment operators. -PROTOBUF_EXPORT Timestamp& operator+=(Timestamp& t, - const Duration& d); // NOLINT -PROTOBUF_EXPORT Timestamp& operator-=(Timestamp& t, - const Duration& d); // NOLINT -// Relational operators. -inline bool operator<(const Timestamp& t1, const Timestamp& t2) { - if (t1.seconds() == t2.seconds()) { - return t1.nanos() < t2.nanos(); - } - return t1.seconds() < t2.seconds(); -} -inline bool operator>(const Timestamp& t1, const Timestamp& t2) { - return t2 < t1; -} -inline bool operator>=(const Timestamp& t1, const Timestamp& t2) { - return !(t1 < t2); -} -inline bool operator<=(const Timestamp& t1, const Timestamp& t2) { - return !(t2 < t1); -} -inline bool operator==(const Timestamp& t1, const Timestamp& t2) { - return t1.seconds() == t2.seconds() && t1.nanos() == t2.nanos(); -} -inline bool operator!=(const Timestamp& t1, const Timestamp& t2) { - return !(t1 == t2); -} -// Additive operators. -inline Timestamp operator+(const Timestamp& t, const Duration& d) { - Timestamp result = t; - return result += d; -} -inline Timestamp operator+(const Duration& d, const Timestamp& t) { - Timestamp result = t; - return result += d; -} -inline Timestamp operator-(const Timestamp& t, const Duration& d) { - Timestamp result = t; - return result -= d; -} -PROTOBUF_EXPORT Duration operator-(const Timestamp& t1, const Timestamp& t2); - -inline std::ostream& operator<<(std::ostream& out, const Timestamp& t) { - out << ::PROTOBUF_NAMESPACE_ID::util::TimeUtil::ToString(t); - return out; -} - -} // namespace protobuf -} // namespace google - -#include <google/protobuf/port_undef.inc> - -#endif // GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__ diff --git a/contrib/libs/tcmalloc/CMakeLists.darwin.txt b/contrib/libs/tcmalloc/CMakeLists.darwin.txt new file mode 100644 index 0000000000..7898448e35 --- /dev/null +++ b/contrib/libs/tcmalloc/CMakeLists.darwin.txt @@ -0,0 +1,9 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(malloc_extension) diff --git a/contrib/libs/tcmalloc/CMakeLists.linux.txt b/contrib/libs/tcmalloc/CMakeLists.linux.txt index 8f96b977ae..51a7593d3c 100644 --- a/contrib/libs/tcmalloc/CMakeLists.linux.txt +++ b/contrib/libs/tcmalloc/CMakeLists.linux.txt @@ -6,6 +6,8 @@ # original buildsystem will not be accepted. +add_subdirectory(malloc_extension) +add_subdirectory(no_percpu_cache) add_library(contrib-libs-tcmalloc) target_compile_options(contrib-libs-tcmalloc PRIVATE diff --git a/contrib/libs/tcmalloc/CMakeLists.txt b/contrib/libs/tcmalloc/CMakeLists.txt index e8c98bfd99..dbfe6fa2c4 100644 --- a/contrib/libs/tcmalloc/CMakeLists.txt +++ b/contrib/libs/tcmalloc/CMakeLists.txt @@ -6,6 +6,8 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/tcmalloc/no_percpu_cache/CMakeLists.txt b/contrib/libs/tcmalloc/no_percpu_cache/CMakeLists.txt index e8c98bfd99..97368e369c 100644 --- a/contrib/libs/tcmalloc/no_percpu_cache/CMakeLists.txt +++ b/contrib/libs/tcmalloc/no_percpu_cache/CMakeLists.txt @@ -6,6 +6,6 @@ # original buildsystem will not be accepted. -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/contrib/libs/tcmalloc/ya.make b/contrib/libs/tcmalloc/ya.make deleted file mode 100644 index b2e00ef0b7..0000000000 --- a/contrib/libs/tcmalloc/ya.make +++ /dev/null @@ -1,39 +0,0 @@ -LIBRARY() - -LICENSE(Apache-2.0) - -LICENSE_TEXTS(.yandex_meta/licenses.list.txt) - -OWNER( - ayles - prime - g:cpp-contrib -) - -# https://github.com/google/tcmalloc -VERSION(2021-10-04-45c59ccbc062ac96d83710205033c656e490d376) - -SRCS( - # Options - tcmalloc/want_hpaa.cc -) - -INCLUDE(common.inc) - -CFLAGS( - -DTCMALLOC_256K_PAGES -) - -END() - -IF (NOT DLL_FOR) - RECURSE( - default - dynamic - malloc_extension - no_percpu_cache - numa_256k - numa_large_pages - small_but_slow - ) -ENDIF() |